From 173eb82d4754e9d63bf7aea9550bb1796acda467 Mon Sep 17 00:00:00 2001 From: aprotim Date: Thu, 18 Oct 2018 12:10:53 -0700 Subject: [PATCH] Filter complex objects out of JSON defaults. --- docs/demo/demo.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 6b3d9862..bfb7db14 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -49,7 +49,14 @@ if ('text' in search) { if ('options' in search) { $optionsElem.value = search.options; } else { - $optionsElem.value = JSON.stringify(marked.getDefaults(), null, ' '); + $optionsElem.value = JSON.stringify( + marked.getDefaults(), + function (key, value) { + if (value && typeof(value) === "object" && Object.getPrototypeOf(value) !== Object.prototype){ + return undefined; + } + return value; + }, ' '); } if (search.outputType) {