diff --git a/bin/exampleDataFactory.js b/bin/exampleDataFactory.js index f6cd6af..2d80863 100644 --- a/bin/exampleDataFactory.js +++ b/bin/exampleDataFactory.js @@ -158,7 +158,7 @@ function copyExampleFiles() { function injectScriptForErrorCatch(content, filename) { const injectVariable = typeof globalErrorLogVariable === 'string' ? globalErrorLogVariable : 'errorLogs'; const injectScriptString = - `var ${injectVariable}=[];window.onerror=function(o,r,e,n){errorLogs.push({message:o,source:r,lineno:e,colno:n})};`; + `var ${injectVariable}=[];window.onerror=function(o,r,e,n){${injectVariable}.push({message:o,source:r,lineno:e,colno:n})};`; const newContent = content.replace(/(\n?)(\s*)(<\/head>)/i, `$1$2$2$1$2$3`); fs.writeFileSync(filename, newContent, {encoding: 'utf-8'}); diff --git a/tuidoc.config.json b/tuidoc.config.json index 2319cf2..69c8e13 100644 --- a/tuidoc.config.json +++ b/tuidoc.config.json @@ -34,7 +34,8 @@ "filePath": "demo/examples", "titles": { "example01-default-template": "1. Default Template" - } + }, + "globalErrorLogVariable": false }, "pathPrefix": "toast-ui.doc" -} \ No newline at end of file +}