Skip to content

Commit

Permalink
fix(create): Correct escaping of quotes in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Oct 6, 2021
1 parent c96938d commit 9537245
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/create/src/gather-user-responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async function generateSources(
* Instead, we disable escaping and use this custom helper to escape only the single quote character.
*/
Handlebars.registerHelper('escapeSingle', (aString: unknown) => {
return typeof aString === 'string' ? aString.replace(`'`, `\\'`) : aString;
return typeof aString === 'string' ? aString.replace(/'/g, `\\'`) : aString;
});

const templateContext = {
Expand Down

0 comments on commit 9537245

Please sign in to comment.