Skip to content

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

Closed

Description

@zaydek

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

Thank you.

Activity

  1. UziTech commented on Mar 24, 2020

    @UziTech
    Member

    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.

  2. zaydek commented on Mar 24, 2020

    @zaydek
    Author

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

  3. UziTech commented on Mar 24, 2020

    @UziTech
    Member

    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.

  4. zaydek commented on Mar 24, 2020

    @zaydek
    Author

    Ah, thanks! Will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions