From 67c431019d7d360e3805fc2a14dcf6c3c7b2c157 Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Thu, 11 Feb 2016 11:00:59 -0700 Subject: [PATCH] Fixes #219 - Marko v3: Use ":" instead of "." for nested tags --- compiler/taglib-lookup/TaglibLookup.js | 2 +- .../nested-tags-missing-parent/template.marko | 8 ++++---- .../autotest/nested-tags-missing-parent/test.js | 4 ++-- .../compiler/autotest/nested-tags/template.marko | 8 ++++---- .../autotest/nested-tags-concise/expected.html | 1 + .../autotest/nested-tags-concise/template.marko | 5 +++++ .../render/autotest/nested-tags-concise/test.js | 1 + .../autotest/nested-tags-deep/template.marko | 16 ++++++++-------- .../nested-tags-empty-body/template.marko | 10 +++++----- .../nested-tags-repeated-parent/template.marko | 16 ++++++++-------- .../autotest/nested-tags-repeated/template.marko | 12 ++++++------ .../nested-tags-self-closing/template.marko | 10 +++++----- .../render/autotest/nested-tags/template.marko | 8 ++++---- 13 files changed, 54 insertions(+), 47 deletions(-) create mode 100644 test/fixtures/render/autotest/nested-tags-concise/expected.html create mode 100644 test/fixtures/render/autotest/nested-tags-concise/template.marko create mode 100644 test/fixtures/render/autotest/nested-tags-concise/test.js diff --git a/compiler/taglib-lookup/TaglibLookup.js b/compiler/taglib-lookup/TaglibLookup.js index ef5279e44..9df95b9a5 100644 --- a/compiler/taglib-lookup/TaglibLookup.js +++ b/compiler/taglib-lookup/TaglibLookup.js @@ -102,7 +102,7 @@ class TaglibLookup { function handleNestedTags(tag, parentTagName) { tag.forEachNestedTag(function(nestedTag) { - var fullyQualifiedName = parentTagName + '.' + nestedTag.name; + var fullyQualifiedName = parentTagName + ':' + nestedTag.name; // Create a clone of the nested tag since we need to add some new // properties var clonedNestedTag = new Tag(); diff --git a/test/fixtures/compiler/autotest/nested-tags-missing-parent/template.marko b/test/fixtures/compiler/autotest/nested-tags-missing-parent/template.marko index 91e5df376..8bb5abf52 100644 --- a/test/fixtures/compiler/autotest/nested-tags-missing-parent/template.marko +++ b/test/fixtures/compiler/autotest/nested-tags-missing-parent/template.marko @@ -1,12 +1,12 @@
- + Header content - + Body content - + Footer content - +
\ No newline at end of file diff --git a/test/fixtures/compiler/autotest/nested-tags-missing-parent/test.js b/test/fixtures/compiler/autotest/nested-tags-missing-parent/test.js index fa64371f4..04de68cc6 100644 --- a/test/fixtures/compiler/autotest/nested-tags-missing-parent/test.js +++ b/test/fixtures/compiler/autotest/nested-tags-missing-parent/test.js @@ -3,6 +3,6 @@ var expect = require('chai').expect; exports.checkError = function(e) { expect(e.toString()).to.contain('Tag not nested within a'); expect(e.toString()).to.contain(''); - expect(e.toString()).to.contain(''); - expect(e.toString()).to.contain(''); + expect(e.toString()).to.contain(''); + expect(e.toString()).to.contain(''); }; \ No newline at end of file diff --git a/test/fixtures/compiler/autotest/nested-tags/template.marko b/test/fixtures/compiler/autotest/nested-tags/template.marko index 520e6ef93..03083cee6 100644 --- a/test/fixtures/compiler/autotest/nested-tags/template.marko +++ b/test/fixtures/compiler/autotest/nested-tags/template.marko @@ -1,11 +1,11 @@ - + Body content - + - + Footer content - + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-concise/expected.html b/test/fixtures/render/autotest/nested-tags-concise/expected.html new file mode 100644 index 000000000..1d4d1d228 --- /dev/null +++ b/test/fixtures/render/autotest/nested-tags-concise/expected.html @@ -0,0 +1 @@ +
Tab 1 content
Tab 3 content
\ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-concise/template.marko b/test/fixtures/render/autotest/nested-tags-concise/template.marko new file mode 100644 index 000000000..78641dc56 --- /dev/null +++ b/test/fixtures/render/autotest/nested-tags-concise/template.marko @@ -0,0 +1,5 @@ +test-nested-tags-tabs + test-nested-tags-tabs:tab title="Tab 1" + - Tab 1 content + test-nested-tags-tabs:tab title="Tab 2" + test-nested-tags-tabs:tab title="Tab 3" - Tab 3 content \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-concise/test.js b/test/fixtures/render/autotest/nested-tags-concise/test.js new file mode 100644 index 000000000..c4013b344 --- /dev/null +++ b/test/fixtures/render/autotest/nested-tags-concise/test.js @@ -0,0 +1 @@ +exports.templateData = {}; diff --git a/test/fixtures/render/autotest/nested-tags-deep/template.marko b/test/fixtures/render/autotest/nested-tags-deep/template.marko index c166228ee..5d6f424dd 100644 --- a/test/fixtures/render/autotest/nested-tags-deep/template.marko +++ b/test/fixtures/render/autotest/nested-tags-deep/template.marko @@ -1,12 +1,12 @@ - - + + Deeply nested! - - - - + + + + Another deeply nested! - - + + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-empty-body/template.marko b/test/fixtures/render/autotest/nested-tags-empty-body/template.marko index 7796a3e40..9eb4b25f7 100644 --- a/test/fixtures/render/autotest/nested-tags-empty-body/template.marko +++ b/test/fixtures/render/autotest/nested-tags-empty-body/template.marko @@ -1,12 +1,12 @@ - + Tab 1 content - + - + - + Tab 3 content - + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-repeated-parent/template.marko b/test/fixtures/render/autotest/nested-tags-repeated-parent/template.marko index 4801ccf3f..d832f99d2 100644 --- a/test/fixtures/render/autotest/nested-tags-repeated-parent/template.marko +++ b/test/fixtures/render/autotest/nested-tags-repeated-parent/template.marko @@ -1,21 +1,21 @@ - + Body content - + - + Footer content - + - + Body content 2 - + - + Footer content 2 - + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-repeated/template.marko b/test/fixtures/render/autotest/nested-tags-repeated/template.marko index a09540cad..a5742932a 100644 --- a/test/fixtures/render/autotest/nested-tags-repeated/template.marko +++ b/test/fixtures/render/autotest/nested-tags-repeated/template.marko @@ -1,14 +1,14 @@ - + Tab 1 content - + - + Tab 2 content - + - + Tab 3 content - + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags-self-closing/template.marko b/test/fixtures/render/autotest/nested-tags-self-closing/template.marko index fb88c2d57..28fbafcb5 100644 --- a/test/fixtures/render/autotest/nested-tags-self-closing/template.marko +++ b/test/fixtures/render/autotest/nested-tags-self-closing/template.marko @@ -1,12 +1,12 @@ - + Tab 1 content - + - + - + Tab 3 content - + \ No newline at end of file diff --git a/test/fixtures/render/autotest/nested-tags/template.marko b/test/fixtures/render/autotest/nested-tags/template.marko index e3523cbfb..d484664b9 100644 --- a/test/fixtures/render/autotest/nested-tags/template.marko +++ b/test/fixtures/render/autotest/nested-tags/template.marko @@ -1,10 +1,10 @@ - + Body content - + - + Footer content - + \ No newline at end of file