Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Can marked return JSON instead of HTML? #1626

Closed
zaydek opened this issue Mar 24, 2020 · 4 comments · Fixed by #1627
Closed

[Question] Can marked return JSON instead of HTML? #1626

zaydek opened this issue Mar 24, 2020 · 4 comments · Fixed by #1627
Labels

Comments

@zaydek
Copy link

zaydek commented Mar 24, 2020

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

Thank you.

@UziTech
Copy link
Member

UziTech commented Mar 24, 2020

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.

@zaydek
Copy link
Author

zaydek commented Mar 24, 2020

Thanks! Are there plans to export inline elements to the lexer output as well?

@UziTech
Copy link
Member

UziTech commented Mar 24, 2020

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.

@zaydek
Copy link
Author

zaydek commented Mar 24, 2020

Ah, thanks! Will close this.

@zaydek zaydek closed this as completed Mar 24, 2020
@UziTech UziTech mentioned this issue Mar 25, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants