From 0ff9bb12c0f4b286ae403965aaee83cb2a667b94 Mon Sep 17 00:00:00 2001 From: Zahav Capper Date: Thu, 11 May 2017 04:54:39 +1000 Subject: [PATCH] Escapes single quotes in value names. --- extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();');