feat: support jsTruthy, #255 #257

This commit is contained in:
harttle
2020-10-08 13:11:02 +08:00
parent f807383f2a
commit 72ee7b4c1e
6 changed files with 68 additions and 18 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ describe('Liquid', function () {
it('should call plugin with Liquid', async function () {
const engine = new Liquid()
engine.plugin(function () {
this.registerFilter('t', isFalsy)
this.registerFilter('t', function (v) { return isFalsy(v, this.context) })
})
const html = await engine.parseAndRender('{{false|t}}')
expect(html).to.equal('true')