Browse Source

fix(create): Correct escaping of quotes in templates

Michael Bromley 4 years ago
parent
commit
9537245fcf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/create/src/gather-user-responses.ts

+ 1 - 1
packages/create/src/gather-user-responses.ts

@@ -180,7 +180,7 @@ async function generateSources(
      * Instead, we disable escaping and use this custom helper to escape only the single quote character.
      * Instead, we disable escaping and use this custom helper to escape only the single quote character.
      */
      */
     Handlebars.registerHelper('escapeSingle', (aString: unknown) => {
     Handlebars.registerHelper('escapeSingle', (aString: unknown) => {
-        return typeof aString === 'string' ? aString.replace(`'`, `\\'`) : aString;
+        return typeof aString === 'string' ? aString.replace(/'/g, `\\'`) : aString;
     });
     });
 
 
     const templateContext = {
     const templateContext = {