Skip to content

Commit

Permalink
fix: variable is not assigned as option's value in errorlog script (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
seonim-ryu authored Apr 29, 2020
1 parent d0e125c commit 80d46ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/exampleDataFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<script>${injectScriptString}</script>$1$2$3`);

fs.writeFileSync(filename, newContent, {encoding: 'utf-8'});
Expand Down
5 changes: 3 additions & 2 deletions tuidoc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"filePath": "demo/examples",
"titles": {
"example01-default-template": "1. Default Template"
}
},
"globalErrorLogVariable": false
},
"pathPrefix": "toast-ui.doc"
}
}

0 comments on commit 80d46ac

Please sign in to comment.