Marked: [Question] Can marked return JSON instead of HTML?

Created on 24 Mar 2020  路  4Comments  路  Source: markedjs/marked

Small question: Can marked.js return JSON instead of HTML?

Thank you.

question

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thyxsl picture thyxsl  路  4Comments

vsemozhetbyt picture vsemozhetbyt  路  4Comments

mjbvz picture mjbvz  路  4Comments

priyesh-diukar picture priyesh-diukar  路  3Comments

pigtooter picture pigtooter  路  4Comments