Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 484d90d

Browse files
supa-creationdanbucholtz
authored andcommitted
fix(templates): escape strings in template
Fix template loading when html element attribute is object and string value contain antislash
1 parent 07e7e05 commit 484d90d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function getTemplateFormat(htmlFilePath: string, content: string) {
176176
content = content.replace(/\r|\n/g, '\\n');
177177
content = content.replace(/\'/g, '\\\'');
178178

179-
return `${getTemplatePrefix(htmlFilePath)}'${content}'${getTemplateSuffix(htmlFilePath)}`;
179+
return `${getTemplatePrefix(htmlFilePath)}\`${content}\`${getTemplateSuffix(htmlFilePath)}`;
180180
}
181181

182182

0 commit comments

Comments
 (0)