Fixes #425 - Breaking change: treat concise line starting with ${ as a dynamic tag name

This commit is contained in:
Patrick Steele-Idem 2016-12-22 16:29:48 -07:00
parent 179a564d9a
commit 291f678492
18 changed files with 26 additions and 16 deletions

View File

@ -59,7 +59,7 @@
"events": "^1.0.2",
"events-light": "^1.0.0",
"he": "^1.1.0",
"htmljs-parser": "^2.0.0",
"htmljs-parser": "^2.1.0",
"lasso-modules-client": "^1.0.0",
"lasso-package-root": "^1.0.0",
"listener-tracker": "^2.0.0",

View File

@ -1,4 +1,4 @@
<var foo bar/>
<assign foo=123 bar='hello'/>
${bar.toUpperCase()} ${foo*10}
-- ${bar.toUpperCase()} ${foo*10}

View File

@ -1 +1 @@
${"<div></div>"}
-- ${"<div></div>"}

View File

@ -1 +1 @@
${"<div></div>"} $!{"<div></div>"}
-- ${"<div></div>"} $!{"<div></div>"}

View File

@ -1 +1 @@
$!{"<div></div>"}
-- $!{"<div></div>"}

View File

@ -1,4 +1,4 @@
div -- Hello ${data.name}
span if(data.name)
${data.name}
-- ${data.name}
p else -- No name!

View File

@ -0,0 +1 @@
<hello-world class="my-class" foo="bar">My nested content</hello-world><foo class="my-class" foo="bar">My nested content</foo>

View File

@ -0,0 +1,5 @@
hello-${data.myTagName} class="my-class" foo="bar"
-- My nested content
${data.foo ? 'foo' : 'bar'} class="my-class" foo="bar"
-- My nested content

View File

@ -0,0 +1,4 @@
exports.templateData = {
myTagName: 'world',
foo: true
};

View File

@ -9,4 +9,4 @@
<input type="checked" checked=(true ? true : false)/>
${count>50 ? ((name ? 'Hello ${name}! ' : '') + 'Over 50') : ((name ? 'Hello ${name}! ' : '') + '50 or less')}
-- ${count>50 ? ((name ? 'Hello ${name}! ' : '') + 'Over 50') : ((name ? 'Hello ${name}! ' : '') + '50 or less')}

View File

@ -1,2 +1,2 @@
<var name=data.name count=data.count/>
${name != null ? "Hello ${name.toUpperCase()}! You have ${count} new messages." : null}
-- ${name != null ? "Hello ${name.toUpperCase()}! You have ${count} new messages." : null}

View File

@ -18,7 +18,7 @@ html lang="en"
ul.features
li for(feature in ['async', 'streaming', 'custom-tags', 'readable', 'modules'])
${feature}
-- ${feature}
ul if(data.colors && data.colors.length)
li for(color in data.colors) -- ${color}

View File

@ -18,7 +18,7 @@ html lang="en"
ul.features
li for(feature in ['async', 'streaming', 'custom-tags', 'readable', 'modules'])
${feature}
-- ${feature}
ul if(data.colors && data.colors.length)
li for(color in data.colors) -- ${color}

View File

@ -6,6 +6,6 @@ html lang="en"
h1 -- Hello ${data.name}!
ul if(data.colors.length)
li for(color in data.colors)
${color}
-- ${color}
div else
-- No colors!

View File

@ -8,6 +8,6 @@ html lang="en"
</h1>
ul if(data.colors.length)
li for(color in data.colors)
${color}
-- ${color}
div else
-- No colors!

View File

@ -1,3 +1,3 @@
<var name='Frank' age=10 foo/>
${name.toUpperCase()} ${age*365} [${foo}]
-- ${name.toUpperCase()} ${age*365} [${foo}]

View File

@ -1 +1 @@
${"WHITE SPACE"}
-- ${"WHITE SPACE"}

View File

@ -1,2 +1,2 @@
$!{data.welcome}
${data.name}
-- $!{data.welcome}
-- ${data.name}