Merge pull request #1155 from sveltejs/ssr-escape-attribute-values

escape attribute values in SSR
pull/7738/head
Rich Harris 8 years ago committed by GitHub
commit 979a16f165

@ -11,7 +11,7 @@ export default function stringifyAttributeValue(block: Block, chunks: Node[]) {
block.contextualise(chunk.expression);
const { snippet } = chunk.metadata;
return '${' + snippet + '}';
return '${__escape(' + snippet + ')}';
})
.join('');
}

@ -0,0 +1,3 @@
export default {
html: `<span title='"foo"'>foo</span>`
};

@ -0,0 +1 @@
<span title='{{"\"foo\""}}'>foo</span>
Loading…
Cancel
Save