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.

Feb 3, 2020 Β· 8:23 AM UTC

5
1
2
Replying to @dsilverstone
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
Replying to @dsilverstone
I'd be interested to hear what the application is β€” I like MarkDown, but whenever I try to move beyond generating a single chunk of HTML find myself having to reach for non-standard extensions.
1
I am working on a tool with a friend which consumes markdown as a semi-structured input format. In order to better report errors in the input, I want to be able to point at the line (and column perhaps) where the error exists.
1
1
Replying to @dsilverstone
What is an AST?
Replying to @dsilverstone
The CommonMark dingus produces and AST (in XML form) as well as rendered output, so could be a useful reference point.
1
1
This tweet is unavailable
The spec is definitely useful, though it doesn't really come out and say "this is the AST" it's more of a set of rules for identifying and parsing the components. AFAICT. Perhaps I missed an AST definition in my skim?