Fixes #649 - New line always added to textarea and other elements for single line/delimited HTML blocks

This commit is contained in:
Patrick Steele-Idem 2017-04-03 16:58:06 -06:00
parent d63003f3d2
commit 698746ff4d
8 changed files with 53 additions and 61 deletions

View File

@ -60,7 +60,7 @@
"events": "^1.0.2",
"events-light": "^1.0.0",
"he": "^1.1.0",
"htmljs-parser": "^2.3.1",
"htmljs-parser": "^2.3.2",
"lasso-caching-fs": "^1.0.1",
"lasso-modules-client": "^2.0.3",
"lasso-package-root": "^1.0.1",

View File

@ -3,8 +3,8 @@ var nodePath = require('path');
exports.check = function(marko, markoCompiler, expect, done) {
var template = marko.load(nodePath.join(__dirname, 'template.marko'));
template.renderToString({ name: 'John' }, function(err, html) {
expect(html).to.equal('Hello John! [async]');
expect(html).to.equal('Hello John![async]');
done();
});
};
};

View File

@ -1 +1 @@
BEFORE 1-A timeout has occurred!2-A timeout has occurred!3-A timeout has occurred!4-A timeout has occurred! AFTER
BEFORE1-A timeout has occurred!2-A timeout has occurred!3-A timeout has occurred!4-A timeout has occurred! AFTER

View File

@ -1 +1 @@
BEFORE 1-A timeout has occurred!2-A timeout has occurred!3-A timeout has occurred!4-A timeout has occurred! AFTER
BEFORE1-A timeout has occurred!2-A timeout has occurred!3-A timeout has occurred!4-A timeout has occurred! AFTER

View File

@ -1,53 +1,46 @@
{
"type": "TemplateRoot",
"body": [
{
"type": "Scriptlet",
"code": " if (true) { ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n HELLO\n"
}
},
{
"type": "Scriptlet",
"code": " } ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n"
}
},
{
"type": "Scriptlet",
"code": " if (false) { ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n WORLD\n"
}
},
{
"type": "Scriptlet",
"code": " } ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n"
}
}
]
}
"type": "TemplateRoot",
"body": [
{
"type": "Scriptlet",
"code": " if (true) { ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n HELLO\n"
}
},
{
"type": "Scriptlet",
"code": " } ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n"
}
},
{
"type": "Scriptlet",
"code": " if (false) { ",
"tag": true
},
{
"type": "Text",
"argument": {
"type": "Literal",
"value": "\n WORLD\n"
}
},
{
"type": "Scriptlet",
"code": " } ",
"tag": true
}
]
}

View File

@ -1 +1 @@
test-circular-renderer-a test-circular-renderer-b
test-circular-renderer-atest-circular-renderer-b

View File

@ -1 +1 @@
test-circular-template-a test-circular-template-b
test-circular-template-atest-circular-template-b

View File

@ -1,4 +1,3 @@
<!DOCTYPE html><html lang="en"><head><title>Marko Templating Engine</title></head><body><h1>Marko Templating Engine</h1><p>Marko is a <i>fast</i> and lightweight templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. It supports both a familiar HTML syntax and a concise, indentation-based syntax.</p><ul class="features"><li>async</li><li>streaming</li><li>custom-tags</li><li>readable</li><li>modules</li></ul><div>No colors!</div><div class="tabs"><ul><li>Tab 1</li><li>Tab 2</li></ul><div class="tab-content"><div class="tab">Body content for Tab 1</div><div class="tab">Body content for Tab 2</div></div></div><script type="text/javascript">if (foo) {
alert('Marko is awesome!');
}
</script><ul><li><a class="nav-link active" href="/">Home</a></li><li><a class="nav-link" href="/docs">Docs</a></li><li><a class="nav-link" href="/blog">Blog</a></li></ul></body></html>
}</script><ul><li><a class="nav-link active" href="/">Home</a></li><li><a class="nav-link" href="/docs">Docs</a></li><li><a class="nav-link" href="/blog">Blog</a></li></ul></body></html>