fix: throw ParseError instead of RenderError for invalid assign expression, closes #519

This commit is contained in:
Harttle
2022-07-15 00:41:51 +08:00
parent 0aca2dd8c1
commit c41a5d5bab
3 changed files with 11 additions and 6 deletions
+4
View File
@@ -256,4 +256,8 @@ describe('Issues', function () {
const html = engine.parseAndRenderSync(`{% for i in (1..10000) %}{{ i }}{% endfor %}`)
expect(html).to.have.lengthOf(38894)
})
it('#519 should throw parse error for invalid assign expression', () => {
const engine = new Liquid()
expect(() => engine.parse('{% assign headshot = https://testurl.com/not_enclosed_in_quotes.jpg %}')).to.throw(/unexpected token at ":/)
})
})