Skip to content

Commit 9e5f527

Browse files
committed
fix
1 parent 7276e5c commit 9e5f527

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/svelte/src/internal/client/dom/hydration.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,21 @@ function get_hydrate_nodes(node, insert_text = false) {
6262
if (data === '[') {
6363
depth += 1;
6464
will_start = true;
65-
} else if (data === ']' && --depth === 0) {
66-
if (insert_text && nodes.length === 0) {
67-
var text = empty();
68-
nodes.push(text);
69-
current_node.before(text);
65+
} else if (data === ']') {
66+
if (!started) {
67+
// TODO get rid of this — it exists because each blocks are doubly wrapped
68+
return null;
7069
}
7170

72-
return nodes;
71+
if (--depth === 0) {
72+
if (insert_text && nodes.length === 0) {
73+
var text = empty();
74+
nodes.push(text);
75+
current_node.before(text);
76+
}
77+
78+
return nodes;
79+
}
7380
}
7481
}
7582

0 commit comments

Comments
 (0)