Small question: Can marked.js return JSON instead of HTML?
Thank you.
You can get the block tokens in json by using marked.lexer(md, options). You can see the lexer output in the demo.
This only shows the block tokens. It does not show the inline tokens inside paragraph tokens.
Thanks! Are there plans to export inline elements to the lexer output as well?
Yes, I am working on that but it might take a while to figure out how to do it without breaking dependents that work around the current way of doing things.
Ah, thanks! Will close this.
Most helpful comment
You can get the block tokens in json by using
marked.lexer(md, options). You can see the lexer output in the demo.This only shows the block tokens. It does not show the inline tokens inside paragraph tokens.