pull/10904/head
Rich Harris 2 years ago
parent 7276e5c8c1
commit 9e5f527cd6

@ -62,14 +62,21 @@ function get_hydrate_nodes(node, insert_text = false) {
if (data === '[') { if (data === '[') {
depth += 1; depth += 1;
will_start = true; will_start = true;
} else if (data === ']' && --depth === 0) { } else if (data === ']') {
if (insert_text && nodes.length === 0) { if (!started) {
var text = empty(); // TODO get rid of this — it exists because each blocks are doubly wrapped
nodes.push(text); return null;
current_node.before(text);
} }
return nodes; if (--depth === 0) {
if (insert_text && nodes.length === 0) {
var text = empty();
nodes.push(text);
current_node.before(text);
}
return nodes;
}
} }
} }

Loading…
Cancel
Save