@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.
- package/dist/grammar.pegjs +8 -1
- package/package.json +1 -1
package/dist/grammar.pegjs
CHANGED
|
@@ -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
|
-
|
|
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"
|