@stacksjs/stx 0.2.184 → 0.2.185
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 +749 -699
- package/dist/component-library.js +183 -8
- package/dist/craft.js +280 -280
- package/dist/expressions.d.ts +29 -0
- package/dist/expressions.js +5 -2
- package/dist/pwa.js +261 -261
- package/dist/server-components.js +5 -2
- package/dist/ssg.js +272 -272
- package/dist/template-hydrator.js +3 -3
- package/package.json +5 -5
|
@@ -253,7 +253,7 @@ async function processServerTemplate(template, context) {
|
|
|
253
253
|
}
|
|
254
254
|
if (value === void 0 || value === null)
|
|
255
255
|
return "";
|
|
256
|
-
return
|
|
256
|
+
return escapeHtmlValue(String(value));
|
|
257
257
|
});
|
|
258
258
|
return result;
|
|
259
259
|
}
|
|
@@ -263,7 +263,7 @@ function processServerTemplateSync(template, context) {
|
|
|
263
263
|
const value = getNestedValue(context, expr.trim());
|
|
264
264
|
if (value === void 0 || value === null)
|
|
265
265
|
return "";
|
|
266
|
-
return
|
|
266
|
+
return escapeHtmlValue(String(value));
|
|
267
267
|
});
|
|
268
268
|
return result;
|
|
269
269
|
}
|
|
@@ -284,6 +284,9 @@ function evaluateCondition(condition, context) {
|
|
|
284
284
|
function escapeHtml(str) {
|
|
285
285
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
286
286
|
}
|
|
287
|
+
function escapeHtmlValue(str) {
|
|
288
|
+
return escapeHtml(str).replace(/\{{2,}/g, (match) => "{".repeat(match.length)).replace(/\{(?=!)/g, "{");
|
|
289
|
+
}
|
|
287
290
|
export const serverComponentDirective = {
|
|
288
291
|
name: "serverComponent",
|
|
289
292
|
hasEndTag: !0,
|