mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Added test case for the bodyText property
This commit is contained in:
parent
2cb0cb6781
commit
f6137d25e8
1
test/autotests/render/bodyText/expected.html
Normal file
1
test/autotests/render/bodyText/expected.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<script><DIV>FOO</DIV></script>
|
||||||
3
test/autotests/render/bodyText/marko.json
Normal file
3
test/autotests/render/bodyText/marko.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tags-dir": "./tags"
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
function compile(bodyText) {
|
||||||
|
return bodyText.toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function generateCode(elNode, codegen) {
|
||||||
|
var builder = codegen.builder;
|
||||||
|
return builder.htmlElement('script', {}, [
|
||||||
|
builder.text(builder.literal(compile(elNode.bodyText)))
|
||||||
|
]);
|
||||||
|
};
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"code-generator": "./code-generator",
|
||||||
|
"body": "static-text",
|
||||||
|
"preserve-whitespace": true
|
||||||
|
}
|
||||||
3
test/autotests/render/bodyText/template.marko
Normal file
3
test/autotests/render/bodyText/template.marko
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<test-bodyText>
|
||||||
|
<div>Foo</div>
|
||||||
|
</test-bodyText>
|
||||||
3
test/autotests/render/bodyText/test.js
Normal file
3
test/autotests/render/bodyText/test.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
exports.templateData = {
|
||||||
|
name: 'John'
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user