Skip to content

Commit

Permalink
handle special characters in exported components (v6.1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRJurman committed Sep 15, 2024
1 parent 1bd597e commit 7fac6f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tram-deco",
"version": "6.1.0",
"version": "6.1.1",
"description": "Declarative Custom Elements using native Web Component APIs and specs",
"main": "tram-deco.js",
"files": [
Expand All @@ -20,7 +20,13 @@
"test": "playwright test --ui",
"test:ci": "playwright test"
},
"keywords": [],
"keywords": [
"web-component",
"html",
"declarative",
"dce",
"custom elements"
],
"author": {
"name": "Jesse Jurman",
"email": "[email protected]",
Expand Down
5 changes: 4 additions & 1 deletion scripts/export-components.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const coreLibrary = fs.readFileSync(path.join(__dirname, '../tram-deco.min.js'))

const formattedDefinitions = componentDefinitions
.map((componentCode) => {
const formattedComponentCode = componentCode.replaceAll('`', '\\`').replaceAll('${', '\\${');
const formattedComponentCode = componentCode
.replaceAll('\\', '\\\\')
.replaceAll('`', '\\`')
.replaceAll('${', '\\${');
return formattedComponentCode;
})
.join('\n');
Expand Down

0 comments on commit 7fac6f1

Please sign in to comment.