From 80d46ac24168be3403d87d0f157d88d570036905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A5=98=EC=84=A0=EC=9E=84?= Date: Wed, 29 Apr 2020 19:23:31 +0900 Subject: [PATCH] fix: variable is not assigned as option's value in errorlog script (#6) --- bin/exampleDataFactory.js | 2 +- tuidoc.config.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 +}