Skip to content

Commit

Permalink
escape prop names during spreads in SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed May 20, 2024
1 parent c8dc99b commit 8771fdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dom-expressions/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export function ssrElement(tag, props, children, needsId) {
} else if (value == undefined || prop === "ref" || prop.slice(0, 2) === "on") {
continue;
} else {
result += `${Aliases[prop] || prop}="${escape(value, true)}"`;
result += `${Aliases[prop] || escape(prop)}="${escape(value, true)}"`;
}
if (i !== keys.length - 1) result += " ";
}
Expand Down Expand Up @@ -668,7 +668,7 @@ export function ssrSpread(props, isSVG, skipChildren) {
continue;
} else {
if (prop.slice(0, 5) === "attr:") prop = prop.slice(5);
result += `${Aliases[prop] || prop}="${escape(value, true)}"`;
result += `${Aliases[prop] || escape(prop)}="${escape(value, true)}"`;
}
if (i !== keys.length - 1) result += " ";
}
Expand Down

0 comments on commit 8771fdf

Please sign in to comment.