Skip to content

Convert JSON back to HTML #81

Open

Description

@tiholic

I would like to convert DOM to JSON, modify the JSON and convet it back to DOM String.

Please suggest

Activity

  1. jywarren commented on Mar 5, 2019

    @jywarren

    I also need this - it looks like you can get the raw version of any node, as in https://www.npmjs.com/package/htmlparser#option-verbose

    However, it's more complex than just adding back the < and > - we'd need to also recurse down into the child notes, AND add close tags </...> for each.

    I wish it would just preserve the entire original HTML for each element, maybe as an original property. This would include a lot of redundant information, but really is useful for some use cases (like ours in publiclab/inline-markdown-editor#52).

  2. jywarren commented on Mar 5, 2019

    @jywarren

    OK, i did a very basic implementation (i think) here: #82. Can folks test it out?

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions