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

Convert JSON back to HTML #81

Open
tiholic opened this issue Jul 25, 2018 · 2 comments
Open

Convert JSON back to HTML #81

tiholic opened this issue Jul 25, 2018 · 2 comments

Comments

@tiholic
Copy link

tiholic commented Jul 25, 2018

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

Please suggest

@jywarren
Copy link

jywarren commented Mar 5, 2019

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).

@jywarren
Copy link

jywarren commented Mar 5, 2019

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants