diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.js index 8661dbb0fb..6e6c33eaff 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.js @@ -264,7 +264,7 @@ function preprocessChildren ( generator, block, state, node, isTopLevel ) { if ( lastChild ) { lastChild.next = child; - lastChild.needsAnchor = !child._state.name; + lastChild.needsAnchor = !child._state || !child._state.name; } lastChild = child; diff --git a/test/runtime/samples/component-yield-follows-element/Foo.html b/test/runtime/samples/component-yield-follows-element/Foo.html new file mode 100644 index 0000000000..1e619f2ecd --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/Foo.html @@ -0,0 +1,2 @@ +
before
+{{yield}} \ No newline at end of file diff --git a/test/runtime/samples/component-yield-follows-element/_config.js b/test/runtime/samples/component-yield-follows-element/_config.js new file mode 100644 index 0000000000..93703c7dab --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/_config.js @@ -0,0 +1,6 @@ +export default { + html: ` +
before
+ test + ` +}; diff --git a/test/runtime/samples/component-yield-follows-element/main.html b/test/runtime/samples/component-yield-follows-element/main.html new file mode 100644 index 0000000000..15747d9d53 --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/main.html @@ -0,0 +1,11 @@ +test + +