From 05bf1391dae16059d8cb89dd0260eac21124dadc Mon Sep 17 00:00:00 2001 From: Mo Morsi Date: Thu, 9 Aug 2018 12:59:51 -0400 Subject: [PATCH] Support DOM elements by simply appending them to the output This allows JSON to be manipulated so as to contain DOM elements before being passed to renderjson. Nested DOM elements will be processed as is, being added to the output DOM structure without modifications (previously the call to createTextNode was resulting in raw HTML being output. --- renderjson.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/renderjson.js b/renderjson.js index 9d41d2d..c569f48 100644 --- a/renderjson.js +++ b/renderjson.js @@ -148,6 +148,9 @@ var module, window, define, renderjson=(function() { }); } + if(json instanceof HTMLElement) + return json; + // object if (isempty(json, options.property_list)) return themetext(null, my_indent, "object syntax", "{}");