@canvasengine/compiler 2.0.0-beta.46 → 2.0.0-beta.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -307,7 +307,14 @@ simpleTextContent "simple text content"
307
307
  simpleTextPart "simple text part"
308
308
  = !("@for" / "@if") text:$([^<{@]+) {
309
309
  const trimmed = text.trim();
310
- return trimmed ? `'${text}'` : null;
310
+ if (!trimmed) return null;
311
+ const escaped = text
312
+ .replace(/\\/g, '\\\\')
313
+ .replace(/'/g, "\\'")
314
+ .replace(/\r/g, '\\r')
315
+ .replace(/\n/g, '\\n')
316
+ .replace(/\t/g, '\\t');
317
+ return `'${escaped}'`;
311
318
  }
312
319
 
313
320
  simpleDynamicPart "simple dynamic part"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canvasengine/compiler",
3
- "version": "2.0.0-beta.46",
3
+ "version": "2.0.0-beta.47",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",