diff --git a/src/generators/dom/preprocess.ts b/src/generators/dom/preprocess.ts
index e9aff13652..1e71361f31 100644
--- a/src/generators/dom/preprocess.ts
+++ b/src/generators/dom/preprocess.ts
@@ -417,6 +417,8 @@ function preprocessChildren(
const preprocessor = preprocessors[child.type];
if (preprocessor) preprocessor(generator, block, state, child, inEachBlock, elementStack, componentStack, stripWhitespace, cleaned[i + 1] || nextSibling);
+ if (child.shouldSkip) return;
+
if (lastChild) lastChild.next = child;
child.prev = lastChild;
diff --git a/test/runtime/samples/svg-each-block-anchor/_config.js b/test/runtime/samples/svg-each-block-anchor/_config.js
new file mode 100644
index 0000000000..9ca280965c
--- /dev/null
+++ b/test/runtime/samples/svg-each-block-anchor/_config.js
@@ -0,0 +1,25 @@
+export default {
+ data: {
+ foo: ['a'],
+ bar: ['c']
+ },
+
+ html: `
+
+ `,
+
+ test(assert, component, target) {
+ component.set({ foo: ['a', 'b'] });
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/svg-each-block-anchor/main.html b/test/runtime/samples/svg-each-block-anchor/main.html
new file mode 100644
index 0000000000..7a299b2c11
--- /dev/null
+++ b/test/runtime/samples/svg-each-block-anchor/main.html
@@ -0,0 +1,9 @@
+
\ No newline at end of file