Skip to content

Commit 478ffd5

Browse files
committed
fix: SVG output move only safe nodes
1 parent a2b2cc5 commit 478ffd5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

templates/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,13 @@
205205
});
206206
});
207207

208-
preview.appendChild(svgEl);
208+
const wrapper = document.createElement('div');
209+
wrapper.appendChild(svgEl);
210+
211+
// move only safe nodes
212+
while (wrapper.firstChild) {
213+
preview.appendChild(wrapper.firstChild);
214+
}
209215
} catch (e) {
210216
preview.replaceChildren();
211217

0 commit comments

Comments
 (0)