Open jonschlinkert opened 8 years ago
If you/someone does create an AST, would it be beneficial to be compatible with MDast? Or are you guys too different?
The mdast AST is more like a cheerio or HTML AST, I'm not a big fan of that. I'd like to keep ours more elegant and simple following snapdragon's conventions. For example, with snapdragon the AST itself is "just another node". All nodes are the same, and all nodes follow the same conventions.
edit: you could easily create a mdast renderer or parser with snapdragon too...
edit2: to be clear, I love cheerio and use it a lot - I just meant the HTML-ish AST (which is beyond cheerio's control. cheerio makes that easy to use. but with markdown or anything else, why make the AST more verbose than it needs to be?)
This is more of a reminder to myself, unless someone wants to do a PR. Currently, the parser is more of a lexer/tokenizer that returns a token stream. I can expose a method for creating an AST.
Something like:
Not sure if this works, but it's probably close.