mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix: url_encode throws on undefined value, fixes #479
This commit is contained in:
@@ -199,4 +199,12 @@ describe('Issues', function () {
|
||||
const html = engine.parseAndRenderSync('{{foo | size}}-{{bar.coo}}', { foo: 'foo', bar: Object.create({ coo: 'COO' }) })
|
||||
expect(html).to.equal('3-')
|
||||
})
|
||||
it('#479 url_encode throws on undefined value', async () => {
|
||||
const engine = new Liquid({
|
||||
strictVariables: false
|
||||
})
|
||||
const tpl = engine.parse('{{ v | url_encode }}')
|
||||
const html = await engine.render(tpl, { v: undefined })
|
||||
expect(html).to.equal('')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user