ReviewOS

also looking at this

stacks/stx

fix(client): preserve client-signal {⁠{ }} + bind SVG classes via setAttribute

#1774
Closed glennmichael123 wants to merge fix/client-signal-interpolation-and-svg-bindclass into main
4 files +354 -293
packages/stx/src/signals.tsmodified+2-2
Changes to packages/stx/src/signals.ts
@@ -1630,7 +1630,7 @@ catch (e) {
16301630 if (el.nodeType === Node.TEXT_NODE) {
16311631 const text = el.textContent;
16321632 if (text && text.includes('{⁠{')) {
1633 const parts = text.split(/(\\{\\{[^}]+\\}\\})/g);
1633 const parts = text.split(/(\\{\\{[\\s\\S]+?\\}\\})/g);
16341634 if (parts.length > 1) {
16351635 const fragment = document.createDocumentFragment();
16361636 const parentEl = el.parentNode;
@@ -1639,7 +1639,7 @@ catch (e) {
16391639 // through nested @if/@for processing where componentScope may be restored
16401640 const capturedScope = { ...scope, ...(findElementScope(parentEl) || {}), ...globalHelpers };
16411641 parts.forEach(part => {
1642 const match = part.match(/^\\{\\{\\s*(.+?)\\s*\\}\\}$/);
1642 const match = part.match(/^\\{\\{\\s*([\\s\\S]+?)\\s*\\}\\}$/);
16431643 if (match) {
16441644 const expr = match[1];
16451645 // Skip placeholder expressions like __TITLE__ (build-time placeholders)