Skip to content

Commit 5669f55

Browse files
committed
Prettier
1 parent 7149c4d commit 5669f55

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ function process_children(nodes, parent, { visit, state }) {
187187
const node = sequence[i];
188188
if (node.type === 'Text' || node.type === 'Comment') {
189189
let last = /** @type {import('estree').TemplateElement} */ (quasis.at(-1));
190-
last.value.raw += node.type === 'Comment' ? `<!--${node.data}-->` : sanitize_template_string(escape_html(node.data));
190+
last.value.raw +=
191+
node.type === 'Comment'
192+
? `<!--${node.data}-->`
193+
: sanitize_template_string(escape_html(node.data));
191194
} else if (node.type === 'Anchor') {
192195
expressions.push(node.id);
193196
quasis.push(b.quasi('', i + 1 === sequence.length));

packages/svelte/src/compiler/utils/sanitize_template_string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
*/
55
export function sanitize_template_string(str) {
66
return str.replace(/(`|\${|\\)/g, '\\$1');
7-
}
7+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test } from '../../test';
22

33
export default test({
4-
html: "<div>/ $clicks: 0 `tim$es` \\</div><div>$dollars `backticks` pyramid /\\</div>"
4+
html: '<div>/ $clicks: 0 `tim$es` \\</div><div>$dollars `backticks` pyramid /\\</div>'
55
});

0 commit comments

Comments
 (0)