@stacksjs/stx 0.2.185 → 0.2.186
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/cli.js +544 -545
- package/dist/component-library.js +24 -13
- package/dist/craft.js +305 -305
- package/dist/expressions.js +5 -1
- package/dist/pwa.js +242 -242
- package/dist/server-components.js +1 -1
- package/dist/ssg.js +239 -239
- package/package.json +5 -5
package/dist/expressions.js
CHANGED
|
@@ -237,7 +237,11 @@ export function escapeHtml(unsafe) {
|
|
|
237
237
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
238
238
|
}
|
|
239
239
|
export function escapeHtmlValue(unsafe) {
|
|
240
|
-
return escapeHtml(unsafe).replace(/\{{2,}/g, (match) =>
|
|
240
|
+
return escapeHtml(unsafe).replace(/\{{2,}/g, (match) => joinBraces(match.length)).replace(/\{(?=!)/g, `{${WORD_JOINER}`);
|
|
241
|
+
}
|
|
242
|
+
const WORD_JOINER = "⁠";
|
|
243
|
+
function joinBraces(length) {
|
|
244
|
+
return Array.from({ length }, () => "{").join(WORD_JOINER);
|
|
241
245
|
}
|
|
242
246
|
export function usesSignalsInScript(template) {
|
|
243
247
|
const { scripts } = stashScriptElements(template);
|