ITADN

Expose Ability to Get the Number Of a List Item

#600Pull Requestbfoersterling 创建于 2026-02-21
B
bfoersterlingcommented
#### rationale The function `cmark_node_get_item_number()` improves the user friendliness \ of the API as the library user does not have to implement a logic to derive \ the number of a list item. It is more efficient to store the item number once when parsing the markdown \ content.\ The function `cmark_node_get_item_number` only has to look at the previous \ node. The library user might need to traverse until the start of the list \ if he does not want to store the item numbers in a separate data type. #### implementation I added the new type `cmark_item` and made it a union member for the `as` \ member in `cmark_node`. The item number is calculated and stored in the function `finalize()`.
合并状态:未合并 2 条评论