fix: support integer arithmetic for divided_by, closes #465

This commit is contained in:
Harttle
2022-04-22 02:19:36 +08:00
parent ace5309c08
commit e69a51025e
5 changed files with 44 additions and 3 deletions
+5
View File
@@ -199,6 +199,11 @@ describe('Issues', function () {
const html = engine.parseAndRenderSync('{{foo | size}}-{{bar.coo}}', { foo: 'foo', bar: Object.create({ coo: 'COO' }) })
expect(html).to.equal('3-')
})
it('#465 Liquidjs divided_by not compatible with Ruby/Shopify Liquid', () => {
const engine = new Liquid({ ownPropertyOnly: true })
const html = engine.parseAndRenderSync('{{ 5 | divided_by: 3, true }}')
expect(html).to.equal('1')
})
it('#479 url_encode throws on undefined value', async () => {
const engine = new Liquid({
strictVariables: false