diff --git a/CHANGELOG.md b/CHANGELOG.md index da918d5d8..fa8cf5f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ Changelog ## 2.7.x +### 2.7.31 + +- Fixes #167 - Nested tags only work one level deep + +### 2.7.30 + +- docs: don't exclude docs in .npmignore + ### 2.7.29 - Fixes #161 - Nested tags with no body content are not handled correctly diff --git a/compiler/taglib-lookup/TaglibLookup.js b/compiler/taglib-lookup/TaglibLookup.js index 94794f952..1cb79683b 100644 --- a/compiler/taglib-lookup/TaglibLookup.js +++ b/compiler/taglib-lookup/TaglibLookup.js @@ -99,24 +99,24 @@ class TaglibLookup { var merged = this.merged; - function handleNestedTag(nestedTag, parentTagName) { - var fullyQualifiedName = parentTagName + '.' + nestedTag.name; - - // Create a clone of the nested tag since we need to add some new - // properties - var clonedNestedTag = new Tag(); - extend(clonedNestedTag ,nestedTag); - // Record the fully qualified name of the parent tag that this - // custom tag is associated with. - clonedNestedTag.parentTagName = parentTagName; - clonedNestedTag.name = fullyQualifiedName; - merged.tags[fullyQualifiedName] = clonedNestedTag; + function handleNestedTags(tag, parentTagName) { + tag.forEachNestedTag(function(nestedTag) { + var fullyQualifiedName = parentTagName + '.' + nestedTag.name; + // Create a clone of the nested tag since we need to add some new + // properties + var clonedNestedTag = new Tag(); + extend(clonedNestedTag, nestedTag); + // Record the fully qualified name of the parent tag that this + // custom tag is associated with. + clonedNestedTag.parentTagName = parentTagName; + clonedNestedTag.name = fullyQualifiedName; + merged.tags[fullyQualifiedName] = clonedNestedTag; + handleNestedTags(clonedNestedTag, fullyQualifiedName); + }); } taglib.forEachTag(function(tag) { - tag.forEachNestedTag(function(nestedTag) { - handleNestedTag(nestedTag, tag.name); - }); + handleNestedTags(tag, tag.name); }); } diff --git a/test/fixtures/marko-taglib.json b/test/fixtures/marko-taglib.json index 0ab8cddce..4e91a238c 100644 --- a/test/fixtures/marko-taglib.json +++ b/test/fixtures/marko-taglib.json @@ -17,4 +17,4 @@ "required": true } } -} \ No newline at end of file +} diff --git a/test/fixtures/render/autotest-pending/nested-tags-deep/expected.html b/test/fixtures/render/autotest-pending/nested-tags-deep/expected.html new file mode 100644 index 000000000..a841d19bb --- /dev/null +++ b/test/fixtures/render/autotest-pending/nested-tags-deep/expected.html @@ -0,0 +1 @@ +