renderjson
renderjson copied to clipboard
Support DOM elements by simply appending them to the output
Greetings! This patch facilitates the inclusion of DOM elements in the JSON data rendered with renderjson. With this one could modify the json ( for example with the 'apply' method in a library such as jsonpath) so as to contain custom DOM elements & formatting for specific items before passing the entire document to renderjson as outlined in the docs. Before this patch, the createTextNode method would result in raw html being rendered on the output DOM structure whereas now DOM elements will simply be added to it.
I've tested and verified this locally, though if this patch is unagreeable or won't work for any particular use case, let me know and we can try to devise and acceptable solution.
Thank you for your time.
I could use this for https://github.com/Almenon/AREPL-vscode/issues/73, nice PR :)
I'm suprised that just took a two line code change.