-
-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hi. I started using markdown-rs and noticed I had to add a panic into my code just because everything is a Node, but List can only really contain ListItems. Since 1.x is still in alpha, I figured this would be a good time to speak up.
Have you considered making the AST types stronger? I think List.children should be Vec<ListItem>, and similarly e.g. Strong cannot contain a Paragraph or a Heading..
mdast supports this line of thinking:
type MdastContent = FlowContent | ListContent | PhrasingContent- https://github.com/syntax-tree/mdast#list says children are https://github.com/syntax-tree/mdast#listcontent which is just an alias for https://github.com/syntax-tree/mdast#listitem
- https://github.com/syntax-tree/mdast#strong says children are https://github.com/syntax-tree/mdast#phrasingcontent
and so on.
I should be able to contribute code too, if you're interested and breaking the API is ok.
Metadata
Metadata
Assignees
Labels
No labels