Skip to content

Commit

Permalink
fix(escaping): Use template literals instead of ' quotes to encapsula…
Browse files Browse the repository at this point in the history
…te svgs, as the quote character can occur in svgs.
  • Loading branch information
akehir committed Mar 27, 2020
1 parent 83651eb commit a5fd0a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ bower_components
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

.DS_Store

# Dependency directories
node_modules/
jspm_packages/
Expand Down
6 changes: 3 additions & 3 deletions src/lib/generators/code-snippet-generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const generateSvgConstant = (
): string => {
return `export const ${variableName}: ${interfaceName} = {
name: '${filenameWithoutEnding}',
data: '${data}'
data: \`${data}\`
};`;
};

Expand All @@ -46,7 +46,7 @@ export const generateSvgConstantWithImport = (
export const ${variableName}: ${interfaceName} = {
name: '${filenameWithoutEnding}',
data: '${data}'
data: \`${data}\`
};`;
};

Expand All @@ -58,7 +58,7 @@ export const generateSvgStandaloneFile = (
): string => {
return `export const ${variableName}: ${interfaceName} = {
name: '${filenameWithoutEnding}',
data: '${data}'
data: \`${data}\`
};`;
};

Expand Down

0 comments on commit a5fd0a4

Please sign in to comment.