mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Switched from "-" to "--" in concise templates
This commit is contained in:
parent
b7b15e4eb1
commit
65b6ff8ef0
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -7,12 +7,12 @@ exports.check = function(marko, markoCompiler, expect, done) {
|
||||
|
||||
// Make sure calling load with templatePath:String, templateSrc:String arguments works
|
||||
templatePath = nodePath.join(__dirname, 'dummy.marko');
|
||||
template = marko.load(templatePath, '- Hello $!{data.name}!');
|
||||
template = marko.load(templatePath, '-- Hello $!{data.name}!');
|
||||
expect(template.renderSync({name: 'Frank'}).toString()).to.equal('Hello Frank!');
|
||||
|
||||
// Make sure calling load with templatePath:String, templateSrc:String, options:Object arguments works
|
||||
templatePath = nodePath.join(__dirname, 'dummy.marko');
|
||||
template = marko.load(templatePath, '- Hello $!{data.name}!', {});
|
||||
template = marko.load(templatePath, '-- Hello $!{data.name}!', {});
|
||||
expect(template.renderSync({name: 'Frank'}).toString()).to.equal('Hello Frank!');
|
||||
|
||||
// Make sure calling load with templatePath:String, options:Object arguments works
|
||||
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- ${out.global.greeting} ${data.name}!
|
||||
-- ${out.global.greeting} ${data.name}!
|
||||
|
||||
@ -1 +1 @@
|
||||
- ${out.global.foo}
|
||||
-- ${out.global.foo}
|
||||
@ -1 +1 @@
|
||||
- ${out.global.foo}
|
||||
-- ${out.global.foo}
|
||||
@ -1 +1 @@
|
||||
- ${out.global.greeting} ${data.name}!
|
||||
-- ${out.global.greeting} ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello!
|
||||
-- Hello!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,2 +1,2 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
<test-async/>
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,2 +1,2 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
<test-async/>
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,4 +1,4 @@
|
||||
- BEFORE
|
||||
-- BEFORE
|
||||
<async-fragment data-provider=data.userInfoShort
|
||||
var="user"
|
||||
timeout=500
|
||||
@ -33,4 +33,4 @@
|
||||
</async-fragment-timeout>
|
||||
4
|
||||
</async-fragment>
|
||||
- AFTER
|
||||
-- AFTER
|
||||
@ -1,4 +1,4 @@
|
||||
- BEFORE
|
||||
-- BEFORE
|
||||
<await(user from data.userInfoShort)
|
||||
timeout=500
|
||||
name="userInfo1">
|
||||
@ -29,4 +29,4 @@
|
||||
</await-timeout>
|
||||
4
|
||||
</await>
|
||||
- AFTER
|
||||
-- AFTER
|
||||
@ -1 +1 @@
|
||||
test-addNestedVariable - Hello ${foo}!
|
||||
test-addNestedVariable -- Hello ${foo}!
|
||||
@ -1,2 +1,2 @@
|
||||
for(color in ['red', 'green', 'blue'] | array)
|
||||
- ${color}
|
||||
-- ${color}
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! Hello $!{data.name}! Hello $!{data.missing}!
|
||||
-- Hello ${data.name}! Hello $!{data.name}! Hello $!{data.missing}!
|
||||
@ -1 +1 @@
|
||||
- Hello John
|
||||
-- Hello John
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -2,8 +2,8 @@ module.exports = function() {
|
||||
var name = 'Frank';
|
||||
var template = marko`
|
||||
div
|
||||
- Hello ${name}!
|
||||
span - Test
|
||||
-- Hello ${name}!
|
||||
span -- Test
|
||||
`;
|
||||
|
||||
return template.renderSync();
|
||||
|
||||
@ -5,7 +5,7 @@ var layout = marko`
|
||||
meta charset="UTF-8"
|
||||
<title>${data.title}</title>
|
||||
body
|
||||
h1 - ${data.title}
|
||||
h1 -- ${data.title}
|
||||
div
|
||||
layout-placeholder name="body"
|
||||
`;
|
||||
@ -17,7 +17,7 @@ module.exports = function() {
|
||||
var template = marko`
|
||||
layout-use(layout) title=title
|
||||
layout-put into="body"
|
||||
- Hello ${name}! This is the body content!
|
||||
-- Hello ${name}! This is the body content!
|
||||
`;
|
||||
|
||||
return template.renderSync();
|
||||
|
||||
@ -1 +1 @@
|
||||
div.bar - BAR
|
||||
div.bar -- BAR
|
||||
@ -1 +1 @@
|
||||
div.foo - FOO
|
||||
div.foo -- FOO
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,4 +1,4 @@
|
||||
<var foo=0/>
|
||||
<assign foo++/>
|
||||
|
||||
- ${foo}
|
||||
-- ${foo}
|
||||
@ -1,4 +1,4 @@
|
||||
<var foo=5/>
|
||||
<assign --foo/>
|
||||
|
||||
- ${foo}
|
||||
-- ${foo}
|
||||
@ -1,3 +1,3 @@
|
||||
div class="foo
|
||||
bar"
|
||||
span - Hello World
|
||||
span -- Hello World
|
||||
@ -1 +1 @@
|
||||
- [foo-template]
|
||||
-- [foo-template]
|
||||
@ -1 +1 @@
|
||||
- A ${'B'} C
|
||||
-- A ${'B'} C
|
||||
@ -1,2 +1,2 @@
|
||||
- test-circular-renderer-a
|
||||
-- test-circular-renderer-a
|
||||
<test-circular-renderer-b/>
|
||||
@ -1,2 +1,2 @@
|
||||
- test-circular-template-a
|
||||
-- test-circular-template-a
|
||||
<test-circular-template-b/>
|
||||
@ -1 +1 @@
|
||||
- test-circular-template-b<test-circular-template-a if(false)/>
|
||||
-- test-circular-template-b<test-circular-template-a if(false)/>
|
||||
@ -1,3 +1,3 @@
|
||||
<!--This comment should not be preserved-->
|
||||
- Hello World!
|
||||
-- Hello World!
|
||||
<!--This comment should not be preserved-->
|
||||
@ -1,4 +1,4 @@
|
||||
div - Hello ${data.name}
|
||||
div -- Hello ${data.name}
|
||||
<span if(data.name)>
|
||||
${data.name}
|
||||
</span>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
div - Hello ${data.name}
|
||||
div -- Hello ${data.name}
|
||||
span if(data.name)
|
||||
${data.name}
|
||||
p else - No name!
|
||||
p else -- No name!
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div data-attr="Hello \"John\" <foo>">
|
||||
Hello <John>© <![CDATA[<hello>]]>
|
||||
</div>
|
||||
- ©
|
||||
-- ©
|
||||
@ -1 +1 @@
|
||||
- Global: ${out.global.foo}
|
||||
-- Global: ${out.global.foo}
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! Hello $!{data.name}! Hello $!{data.missing}!
|
||||
-- Hello ${data.name}! Hello $!{data.name}! Hello $!{data.missing}!
|
||||
@ -1 +1 @@
|
||||
- Hello John
|
||||
-- Hello John
|
||||
@ -1,2 +1,2 @@
|
||||
if(true)
|
||||
- A
|
||||
-- A
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
if(false)
|
||||
- A
|
||||
-- A
|
||||
else
|
||||
- B
|
||||
-- B
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
if(false)
|
||||
- A
|
||||
-- A
|
||||
else if(true)
|
||||
- B
|
||||
-- B
|
||||
@ -1,6 +1,6 @@
|
||||
if(false)
|
||||
- A
|
||||
-- A
|
||||
else if(false)
|
||||
- B
|
||||
-- B
|
||||
else
|
||||
- C
|
||||
-- C
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<import mod, { b as bar } from "./bar" />
|
||||
<import test from './bar' />
|
||||
- ${mod.foo} ${bar} ${test.foo}
|
||||
-- ${mod.foo} ${bar} ${test.foo}
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! You have ${data.count} new messages.
|
||||
-- Hello ${data.name}! You have ${data.count} new messages.
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! You have ${data.count} new messages.
|
||||
-- Hello ${data.name}! You have ${data.count} new messages.
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! You have ${data.count} new messages.
|
||||
-- Hello ${data.name}! You have ${data.count} new messages.
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.firstName} ${data.lastName}!
|
||||
-- Hello ${data.firstName} ${data.lastName}!
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.firstName}! You have ${data.count} new messages.
|
||||
-- Hello ${data.firstName}! You have ${data.count} new messages.
|
||||
@ -1 +1 @@
|
||||
- Hello ${data.name}! You have ${data.count} new messages.
|
||||
-- Hello ${data.name}! You have ${data.count} new messages.
|
||||
@ -5,4 +5,4 @@
|
||||
</div>
|
||||
div
|
||||
// This comment should be preserved
|
||||
- Hello World!
|
||||
-- Hello World!
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
test-nested-tags-tabs
|
||||
test-nested-tags-tabs:tab title="Tab 1"
|
||||
- Tab 1 content
|
||||
-- Tab 1 content
|
||||
test-nested-tags-tabs:tab title="Tab 2"
|
||||
test-nested-tags-tabs:tab title="Tab 3" - Tab 3 content
|
||||
test-nested-tags-tabs:tab title="Tab 3" -- Tab 3 content
|
||||
@ -1,3 +1,3 @@
|
||||
<my-custom-tag short="World"/>
|
||||
|
||||
- Hello ${data.short}
|
||||
-- Hello ${data.short}
|
||||
@ -1,2 +1,2 @@
|
||||
div#foo-${data.name} style="color: red;"
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,2 +1,2 @@
|
||||
div#foo style="color: red;"
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -1,2 +1,2 @@
|
||||
div.foo style="color: red;"
|
||||
- Hello ${data.name}!
|
||||
-- Hello ${data.name}!
|
||||
@ -4,9 +4,9 @@ var currentPage='home'
|
||||
<!DOCTYPE html>
|
||||
html lang="en"
|
||||
head
|
||||
title - ${pageTitle}
|
||||
title -- ${pageTitle}
|
||||
body
|
||||
h1 - ${pageTitle}
|
||||
h1 -- ${pageTitle}
|
||||
|
||||
p
|
||||
---
|
||||
@ -21,15 +21,15 @@ html lang="en"
|
||||
${feature}
|
||||
|
||||
ul if(data.colors && data.colors.length)
|
||||
li for(color in data.colors) - ${color}
|
||||
li for(color in data.colors) -- ${color}
|
||||
div else
|
||||
- No colors!
|
||||
-- No colors!
|
||||
|
||||
tabs
|
||||
tabs:tab title="Tab 1"
|
||||
- Body content for Tab 1
|
||||
-- Body content for Tab 1
|
||||
tabs:tab title="Tab 2"
|
||||
- Body content for Tab 2
|
||||
-- Body content for Tab 2
|
||||
|
||||
script type='text/javascript'
|
||||
---
|
||||
@ -40,7 +40,7 @@ html lang="en"
|
||||
|
||||
macro navLink(id, href, title)
|
||||
li
|
||||
a.nav-link class=(id === currentPage && 'active') href=href - ${title}
|
||||
a.nav-link class=(id === currentPage && 'active') href=href -- ${title}
|
||||
|
||||
ul
|
||||
navLink('home', '/', 'Home')
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
<!DOCTYPE html>
|
||||
html lang="en"
|
||||
head
|
||||
title - ${pageTitle}
|
||||
title -- ${pageTitle}
|
||||
body
|
||||
h1 - ${pageTitle}
|
||||
h1 -- ${pageTitle}
|
||||
|
||||
p
|
||||
---
|
||||
@ -21,15 +21,15 @@ html lang="en"
|
||||
${feature}
|
||||
|
||||
ul if(data.colors && data.colors.length)
|
||||
li for(color in data.colors) - ${color}
|
||||
li for(color in data.colors) -- ${color}
|
||||
div else
|
||||
- No colors!
|
||||
-- No colors!
|
||||
|
||||
tabs
|
||||
tabs:tab title="Tab 1"
|
||||
- Body content for Tab 1
|
||||
-- Body content for Tab 1
|
||||
tabs:tab title="Tab 2"
|
||||
- Body content for Tab 2
|
||||
-- Body content for Tab 2
|
||||
|
||||
<script type='text/javascript'>
|
||||
if (foo) {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
html lang="en"
|
||||
head
|
||||
title - Marko Templating Engine
|
||||
title -- Marko Templating Engine
|
||||
body
|
||||
h1 - Hello ${data.name}!
|
||||
h1 -- Hello ${data.name}!
|
||||
ul if(data.colors.length)
|
||||
li for(color in data.colors)
|
||||
${color}
|
||||
div else
|
||||
- No colors!
|
||||
-- No colors!
|
||||
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
html lang="en"
|
||||
head
|
||||
title - Marko Templating Engine
|
||||
title -- Marko Templating Engine
|
||||
body
|
||||
<h1>
|
||||
Hello ${data.name}!
|
||||
@ -10,4 +10,4 @@ html lang="en"
|
||||
li for(color in data.colors)
|
||||
${color}
|
||||
div else
|
||||
- No colors!
|
||||
-- No colors!
|
||||
@ -1 +1 @@
|
||||
- [icon-list]
|
||||
-- [icon-list]
|
||||
@ -1,3 +1,3 @@
|
||||
var n=0
|
||||
ul
|
||||
li while(n < 4) - ${n++}
|
||||
li while(n < 4) -- ${n++}
|
||||
@ -1,4 +1,4 @@
|
||||
var n=0
|
||||
ul
|
||||
while(n < 4)
|
||||
li - ${n++}
|
||||
li -- ${n++}
|
||||
@ -4,7 +4,7 @@ var marko_template = module.exports = require("marko/vdom").t(__filename),
|
||||
test_hello_tag = marko_loadTag(require("./tags/test-hello/renderer")),
|
||||
marko_createElement = marko_helpers.e,
|
||||
marko_const = marko_helpers.const,
|
||||
marko_const_nextId = marko_const("b7b61f"),
|
||||
marko_const_nextId = marko_const("cee604"),
|
||||
marko_node0 = marko_createElement("a", {
|
||||
href: "foo"
|
||||
}, 1, marko_const_nextId())
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
div
|
||||
test-hello name="World"
|
||||
a href="foo"
|
||||
- Body content
|
||||
-- Body content
|
||||
@ -1 +1 @@
|
||||
- Hello ${name}! $!{message}
|
||||
-- Hello ${name}! $!{message}
|
||||
@ -1,2 +1,2 @@
|
||||
div class="app-dom-events-jquery" w-bind="./widget"
|
||||
button type="button" w-id="button" - Button
|
||||
button type="button" w-id="button" -- Button
|
||||
|
||||
@ -1 +1 @@
|
||||
- [app-widgetless]
|
||||
-- [app-widgetless]
|
||||
@ -1,2 +1,2 @@
|
||||
div class="app-dom-events-jquery"
|
||||
button type="button" ref="button" - Button
|
||||
button type="button" ref="button" -- Button
|
||||
|
||||
@ -1 +1 @@
|
||||
- [app-widgetless]
|
||||
-- [app-widgetless]
|
||||
@ -4,7 +4,7 @@ lasso-page dependencies=data.browserDependencies lasso=data.lasso
|
||||
html lang="en"
|
||||
head
|
||||
meta charset="UTF-8"
|
||||
title - Marko Widgets Tests
|
||||
title -- Marko Widgets Tests
|
||||
lasso-head
|
||||
body
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ lasso-page dependencies=data.browserDependencies lasso=data.lasso
|
||||
html lang="en"
|
||||
head
|
||||
meta charset="UTF-8"
|
||||
title - Marko Widgets Tests
|
||||
title -- Marko Widgets Tests
|
||||
lasso-head
|
||||
body
|
||||
|
||||
|
||||
@ -6,11 +6,11 @@ div
|
||||
onClick('handleButtonClick', {type: 'ok'})
|
||||
onMouseMove('handleButtonMouseMove', {type: 'ok'})
|
||||
]
|
||||
- OK
|
||||
-- OK
|
||||
button [
|
||||
ref="cancel"
|
||||
type="button"
|
||||
onClick('handleButtonClick', {type: 'cancel'})
|
||||
onMouseMove('handleButtonMouseMove', {type: 'cancel'})
|
||||
]
|
||||
- Cancel
|
||||
-- Cancel
|
||||
@ -4,7 +4,7 @@ lasso-page dependencies=data.browserDependencies lasso=data.lasso
|
||||
html lang="en"
|
||||
head
|
||||
meta charset="UTF-8"
|
||||
title - Marko Widgets Tests
|
||||
title -- Marko Widgets Tests
|
||||
lasso-head
|
||||
body
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ lasso-page dependencies=data.browserDependencies lasso=data.lasso
|
||||
html lang="en"
|
||||
head
|
||||
meta charset="UTF-8"
|
||||
title - Marko Widgets Tests
|
||||
title -- Marko Widgets Tests
|
||||
lasso-head
|
||||
body
|
||||
await(components from componentsDataProvider)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user