Merge pull request #619 from sveltejs/gh-616

also escape back-ticks and backslashes in text nodes in SSR code (#616)
pull/628/head
Rich Harris 8 years ago committed by GitHub
commit 9c20938566

@ -7,5 +7,5 @@ export default function visitText(
block: Block,
node: Node
) {
generator.append(node.data.replace(/\${/g, '\\${'));
generator.append(node.data.replace(/(\${|`|\\)/g, '\\$1'));
}

@ -0,0 +1,3 @@
export default {
html: '<code>`${foo}\\n`</code>'
};
Loading…
Cancel
Save