feat: support function calls, closes #222

This commit is contained in:
harttle
2021-02-12 13:47:30 +08:00
parent 81e11bb9c4
commit e37824fd8a
4 changed files with 17 additions and 4 deletions
+8
View File
@@ -70,4 +70,12 @@ describe('Issues', function () {
const html = await engine.parseAndRender(`{{ '{{' }}{{ '}}' }}`)
expect(html).to.equal('{{}}')
})
it('#222 Support function calls', async () => {
const engine = new Liquid()
const html = await engine.parseAndRender(
`{{ obj.property }}`,
{ obj: { property: () => 'BAR' } }
)
expect(html).to.equal('BAR')
})
})