diff --git a/extension.js b/extension.js index 2944408..1dd26a5 100644 --- a/extension.js +++ b/extension.js @@ -59,7 +59,7 @@ function activate(context) { text ? vscode.commands.executeCommand('editor.action.insertLineAfter') .then(() => { - const logToInsert = `console.log('${text}: ', ${text});`; + const logToInsert = `console.log('${text.replace(/'/g,'\\\'')}: ', ${text});`; insertText(logToInsert); }) : insertText('console.log();');