Fixes #219 - Marko v3: Use ":" instead of "." for nested tags

This commit is contained in:
Patrick Steele-Idem 2016-02-11 11:00:59 -07:00
parent 8f9d1094af
commit 67c431019d
13 changed files with 54 additions and 47 deletions

View File

@ -102,7 +102,7 @@ class TaglibLookup {
function handleNestedTags(tag, parentTagName) { function handleNestedTags(tag, parentTagName) {
tag.forEachNestedTag(function(nestedTag) { 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 // Create a clone of the nested tag since we need to add some new
// properties // properties
var clonedNestedTag = new Tag(); var clonedNestedTag = new Tag();

View File

@ -1,12 +1,12 @@
<div> <div>
<test-nested-tags-overlay.header class="my-header"> <test-nested-tags-overlay:header class="my-header">
Header content Header content
</test-nested-tags-overlay.header> </test-nested-tags-overlay:header>
Body content Body content
<test-nested-tags-overlay.footer class="my-footer"> <test-nested-tags-overlay:footer class="my-footer">
Footer content Footer content
</test-nested-tags-overlay.footer> </test-nested-tags-overlay:footer>
</div> </div>

View File

@ -3,6 +3,6 @@ var expect = require('chai').expect;
exports.checkError = function(e) { exports.checkError = function(e) {
expect(e.toString()).to.contain('Tag not nested within a'); expect(e.toString()).to.contain('Tag not nested within a');
expect(e.toString()).to.contain('<test-nested-tags-overlay>'); expect(e.toString()).to.contain('<test-nested-tags-overlay>');
expect(e.toString()).to.contain('<test-nested-tags-overlay.header>'); expect(e.toString()).to.contain('<test-nested-tags-overlay:header>');
expect(e.toString()).to.contain('<test-nested-tags-overlay.footer>'); expect(e.toString()).to.contain('<test-nested-tags-overlay:footer>');
}; };

View File

@ -1,11 +1,11 @@
<test-nested-tags-overlay header="data.header"> <test-nested-tags-overlay header="data.header">
<test-nested-tags-overlay.body class="my-body"> <test-nested-tags-overlay:body class="my-body">
Body content Body content
</test-nested-tags-overlay.body> </test-nested-tags-overlay:body>
<test-nested-tags-overlay.footer class="my-footer"> <test-nested-tags-overlay:footer class="my-footer">
Footer content Footer content
</test-nested-tags-overlay.footer> </test-nested-tags-overlay:footer>
</test-nested-tags-overlay> </test-nested-tags-overlay>

View File

@ -0,0 +1 @@
<div class="tabs"><ul><li>Tab 1</li><li>Tab 2</li><li>Tab 3</li></ul><div class="tab-content"><div class="tab">Tab 1 content</div><div class="tab"></div><div class="tab">Tab 3 content</div></div></div>

View File

@ -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

View File

@ -0,0 +1 @@
exports.templateData = {};

View File

@ -1,12 +1,12 @@
<test-nested-tags-deep class="nested-tags-deep"> <test-nested-tags-deep class="nested-tags-deep">
<test-nested-tags-deep.item foo="bar"> <test-nested-tags-deep:item foo="bar">
<test-nested-tags-deep.item.body> <test-nested-tags-deep:item:body>
<b>Deeply nested!</b> <b>Deeply nested!</b>
</test-nested-tags-deep.item.body> </test-nested-tags-deep:item:body>
</test-nested-tags-deep.item> </test-nested-tags-deep:item>
<test-nested-tags-deep.item foo="baz"> <test-nested-tags-deep:item foo="baz">
<test-nested-tags-deep.item.body> <test-nested-tags-deep:item:body>
<b>Another deeply nested!</b> <b>Another deeply nested!</b>
</test-nested-tags-deep.item.body> </test-nested-tags-deep:item:body>
</test-nested-tags-deep.item> </test-nested-tags-deep:item>
</test-nested-tags-deep> </test-nested-tags-deep>

View File

@ -1,12 +1,12 @@
<test-nested-tags-tabs> <test-nested-tags-tabs>
<test-nested-tags-tabs.tab title="Tab 1"> <test-nested-tags-tabs:tab title="Tab 1">
Tab 1 content Tab 1 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
<test-nested-tags-tabs.tab title="Tab 2"></test-nested-tags-tabs.tab> <test-nested-tags-tabs:tab title="Tab 2"></test-nested-tags-tabs:tab>
<test-nested-tags-tabs.tab title="Tab 3"> <test-nested-tags-tabs:tab title="Tab 3">
Tab 3 content Tab 3 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
</test-nested-tags-tabs> </test-nested-tags-tabs>

View File

@ -1,21 +1,21 @@
<test-nested-tags-overlay header=data.header> <test-nested-tags-overlay header=data.header>
<test-nested-tags-overlay.body class="my-body"> <test-nested-tags-overlay:body class="my-body">
Body content Body content
</test-nested-tags-overlay.body> </test-nested-tags-overlay:body>
<test-nested-tags-overlay.footer class="my-footer"> <test-nested-tags-overlay:footer class="my-footer">
Footer content Footer content
</test-nested-tags-overlay.footer> </test-nested-tags-overlay:footer>
</test-nested-tags-overlay> </test-nested-tags-overlay>
<test-nested-tags-overlay> <test-nested-tags-overlay>
<test-nested-tags-overlay.body class="my-body"> <test-nested-tags-overlay:body class="my-body">
Body content 2 Body content 2
</test-nested-tags-overlay.body> </test-nested-tags-overlay:body>
<test-nested-tags-overlay.footer class="my-footer"> <test-nested-tags-overlay:footer class="my-footer">
Footer content 2 Footer content 2
</test-nested-tags-overlay.footer> </test-nested-tags-overlay:footer>
</test-nested-tags-overlay> </test-nested-tags-overlay>

View File

@ -1,14 +1,14 @@
<test-nested-tags-tabs> <test-nested-tags-tabs>
<test-nested-tags-tabs.tab title="Tab 1"> <test-nested-tags-tabs:tab title="Tab 1">
Tab 1 content Tab 1 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
<test-nested-tags-tabs.tab title="Tab 2" if(false)> <test-nested-tags-tabs:tab title="Tab 2" if(false)>
Tab 2 content Tab 2 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
<test-nested-tags-tabs.tab title="Tab 3"> <test-nested-tags-tabs:tab title="Tab 3">
Tab 3 content Tab 3 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
</test-nested-tags-tabs> </test-nested-tags-tabs>

View File

@ -1,12 +1,12 @@
<test-nested-tags-tabs> <test-nested-tags-tabs>
<test-nested-tags-tabs.tab title="Tab 1"> <test-nested-tags-tabs:tab title="Tab 1">
Tab 1 content Tab 1 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
<test-nested-tags-tabs.tab title="Tab 2"/> <test-nested-tags-tabs:tab title="Tab 2"/>
<test-nested-tags-tabs.tab title="Tab 3"> <test-nested-tags-tabs:tab title="Tab 3">
Tab 3 content Tab 3 content
</test-nested-tags-tabs.tab> </test-nested-tags-tabs:tab>
</test-nested-tags-tabs> </test-nested-tags-tabs>

View File

@ -1,10 +1,10 @@
<test-nested-tags-overlay header=data.header> <test-nested-tags-overlay header=data.header>
<test-nested-tags-overlay.body class="my-body"> <test-nested-tags-overlay:body class="my-body">
Body content Body content
</test-nested-tags-overlay.body> </test-nested-tags-overlay:body>
<test-nested-tags-overlay.footer class="my-footer"> <test-nested-tags-overlay:footer class="my-footer">
Footer content Footer content
</test-nested-tags-overlay.footer> </test-nested-tags-overlay:footer>
</test-nested-tags-overlay> </test-nested-tags-overlay>