Skip to content

Commit 2372f17

Browse files
committed
fix svelte element new lines
1 parent 452c997 commit 2372f17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,10 @@ const svelte_visitors = {
756756
context.visit(node.tag);
757757
context.write('}');
758758
attributes(node.attributes, context);
759-
// TODO new line handling not working?
759+
760760
if (node.fragment && node.fragment.nodes.length > 0) {
761761
context.write('>');
762-
block(context, node.fragment, true);
762+
block(context, node.fragment);
763763
context.write(`</svelte:element>`);
764764
} else {
765765
context.write(' />');

packages/svelte/tests/print/samples/svelte-element/output.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
let tag = $state('hr');
33
</script>
44

5-
<svelte:element this={tag}>This text cannot appear inside an hr element</svelte:element>
5+
<svelte:element this={tag}>
6+
This text cannot appear inside an hr element
7+
</svelte:element>

0 commit comments

Comments
 (0)