Skip to content

Commit a5fd0a4

Browse files
committed
fix(escaping): Use template literals instead of ' quotes to encapsulate svgs, as the quote character can occur in svgs.
1 parent 83651eb commit a5fd0a4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ bower_components
3232
# Compiled binary addons (https://nodejs.org/api/addons.html)
3333
build/Release
3434

35+
.DS_Store
36+
3537
# Dependency directories
3638
node_modules/
3739
jspm_packages/

src/lib/generators/code-snippet-generators.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const generateSvgConstant = (
3030
): string => {
3131
return `export const ${variableName}: ${interfaceName} = {
3232
name: '${filenameWithoutEnding}',
33-
data: '${data}'
33+
data: \`${data}\`
3434
};`;
3535
};
3636

@@ -46,7 +46,7 @@ export const generateSvgConstantWithImport = (
4646
4747
export const ${variableName}: ${interfaceName} = {
4848
name: '${filenameWithoutEnding}',
49-
data: '${data}'
49+
data: \`${data}\`
5050
};`;
5151
};
5252

@@ -58,7 +58,7 @@ export const generateSvgStandaloneFile = (
5858
): string => {
5959
return `export const ${variableName}: ${interfaceName} = {
6060
name: '${filenameWithoutEnding}',
61-
data: '${data}'
61+
data: \`${data}\`
6262
};`;
6363
};
6464

0 commit comments

Comments
 (0)