Dear Lazyweb/Twitterverse, Do you have a favourite Markdown AST? I am already looking at Pandoc's AST for inspiration, but other examples would be useful. Any programming language is fine, I am capable of consuming ideas from most genres. Thanks, D.
5
1
2
Being not so far from, but probably far simpler than, HTML, maybe html5ever for inspiration?
1
I would prefer an AST which was moderately easily returned to markdown, rather than one which is lower level (which I'd consider HTML to be) but not a bad idea if other options aren't useful inspiration enough, thanks.
1
1
We adopted a mix of pandoc and filters to structure and render information; so I ported an existing tool to render to AST and thought "I may as well use pandoc to replace the existing backends" and the short answer is, no, you can't always render back to markdown...
1
1
Replying to @ptoboley @nuxeh
Oh indeed it's not always possible to; but if the AST is designed to represent Markdown rather than the generic form that Pandoc's AST takes, it ought to be *more* possible.

Feb 4, 2020 ยท 7:15 PM UTC

1
1
Replying to @dsilverstone @nuxeh
This is probably true. Conversion to LaTeX is fine, which perhaps shows pandoc has a bias in that direction? Iirc the biggest issue was weird stuff like anchors in tables or dictionaries.
1