mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Update README.md
This commit is contained in:
parent
12684e2b82
commit
88702b2514
22
README.md
22
README.md
@ -380,25 +380,25 @@ module.exports = function create(__helpers) {
|
|||||||
escapeXmlAttr = __helpers.xa;
|
escapeXmlAttr = __helpers.xa;
|
||||||
|
|
||||||
return function render(data, context) {
|
return function render(data, context) {
|
||||||
context.w(('Hello ') +
|
context.w('Hello ' +
|
||||||
(escapeXml(data.name)) +
|
escapeXml(data.name) +
|
||||||
('! '));
|
'! ');
|
||||||
|
|
||||||
if (notEmpty(data.colors)) {
|
if (notEmpty(data.colors)) {
|
||||||
context.w(('<ul>'));
|
context.w('<ul>');
|
||||||
|
|
||||||
forEach(data.colors, function(color) {
|
forEach(data.colors, function(color) {
|
||||||
context.w(('<li style="color: ') +
|
context.w('<li style="color: ' +
|
||||||
(escapeXmlAttr(color)) +
|
escapeXmlAttr(color) +
|
||||||
('">') +
|
'">' +
|
||||||
(escapeXml(color)) +
|
escapeXml(color) +
|
||||||
('</li>'));
|
'</li>');
|
||||||
});
|
});
|
||||||
|
|
||||||
context.w(('</ul>'));
|
context.w('</ul>');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
context.w(('<div>No colors!</div>'));
|
context.w('<div>No colors!</div>');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user