mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 22:40:48 -07:00
async Register Tags example
This commit is contained in:
@@ -226,11 +226,9 @@ engine.registerTag('upper', {
|
|||||||
parse: function(tagToken, remainTokens) {
|
parse: function(tagToken, remainTokens) {
|
||||||
this.str = tagToken.args; // name
|
this.str = tagToken.args; // name
|
||||||
},
|
},
|
||||||
render: function(scope, hash) {
|
render: async function(scope, hash) {
|
||||||
var str = Liquid.evalValue(this.str, scope); // 'alice'
|
var str = await Liquid.evalValue(this.str, scope); // 'alice'
|
||||||
return str.then(function(name) {
|
return str.toUpperCase() // 'Alice'
|
||||||
return name.toUpperCase() // 'Alice'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user