renderjson icon indicating copy to clipboard operation
renderjson copied to clipboard

Support DOM elements by simply appending them to the output

Open movitto opened this issue 6 years ago • 1 comments

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.

movitto avatar Aug 09 '18 17:08 movitto

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.

Almenon avatar Nov 03 '18 04:11 Almenon