You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't read the parser thoroughly, but it looks like to_mdast() always returns mdast::Node::Root(_) on success, even if the source document looks like a simple "inline" text.
If so, isn't it natural and explicit to return mdast::Root directly instead of wrapping it to mdast::Node enum?
Or if it can return something other than mdast::Node::Root(_) variant, the condition would be worth documented.
I'm wondering my converter over md AST can assume that the returned AST is always mdast::Root.
The text was updated successfully, but these errors were encountered:
Hey! It does indeed always return a root. I don’t have strong opinions on this. The AST can be improved though. That’s one of the main reasons this is still alpha. There are different issues about it.
I haven't read the parser thoroughly, but it looks like
to_mdast()
always returnsmdast::Node::Root(_)
on success, even if the source document looks like a simple "inline" text.If so, isn't it natural and explicit to return
mdast::Root
directly instead of wrapping it tomdast::Node
enum?Or if it can return something other than
mdast::Node::Root(_)
variant, the condition would be worth documented.I'm wondering my converter over md AST can assume that the returned AST is always
mdast::Root
.The text was updated successfully, but these errors were encountered: