@stacksjs/stx 0.2.184 → 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.
@@ -253,7 +253,7 @@ async function processServerTemplate(template, context) {
253
253
  }
254
254
  if (value === void 0 || value === null)
255
255
  return "";
256
- return escapeHtml(String(value));
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 escapeHtml(String(value));
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, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
286
286
  }
287
+ function escapeHtmlValue(str) {
288
+ return escapeHtml(str).replace(/\{{2,}/g, (match) => Array.from({ length: match.length }, () => "&#123;").join("&#8288;")).replace(/\{(?=!)/g, "&#123;&#8288;");
289
+ }
287
290
  export const serverComponentDirective = {
288
291
  name: "serverComponent",
289
292
  hasEndTag: !0,