Filter complex objects out of JSON defaults.

This commit is contained in:
aprotim 2018-10-18 12:10:53 -07:00 committed by GitHub
parent cf7fab7051
commit 173eb82d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,14 @@ if ('text' in search) {
if ('options' in search) { if ('options' in search) {
$optionsElem.value = search.options; $optionsElem.value = search.options;
} else { } 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) { if (search.outputType) {