Skip to content

Commit 4d920c6

Browse files
committed
try putting static stuff in the template
1 parent bba8242 commit 4d920c6

File tree

1 file changed

+5
-3
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared

1 file changed

+5
-3
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/fragment.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ export function process_children(nodes, initial, is_element, { visit, state }) {
6868
return;
6969
}
7070

71-
state.template.push(' ');
72-
7371
const { has_state, value } = build_template_chunk(sequence, visit, state);
7472

7573
// if this is a standalone `{expression}`, make sure we handle the case where
@@ -81,8 +79,12 @@ export function process_children(nodes, initial, is_element, { visit, state }) {
8179

8280
if (has_state && !within_bound_contenteditable) {
8381
state.update.push(update);
84-
} else {
82+
state.template.push(' ');
83+
} else if (value.type !== 'Literal') {
8584
state.init.push(b.stmt(b.assignment('=', b.member(id, 'nodeValue'), value)));
85+
state.template.push(' ');
86+
} else if (value.type === 'Literal') {
87+
state.template.push((value.value ?? '') + '');
8688
}
8789
}
8890

0 commit comments

Comments
 (0)