Skip to content

Commit

Permalink
Merge pull request #31 from akehir/fix/template-literals-for-svg-code
Browse files Browse the repository at this point in the history
fix(escaping): Use template literals instead of ' quotes to encapsula…
  • Loading branch information
nivekcode authored Mar 28, 2020
2 parents 83651eb + a5fd0a4 commit 05d2cfa
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 05d2cfa

Please sign in to comment.