mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: allow string literals contain delimiters, fixes #288
This commit is contained in:
+6
-1
@@ -56,7 +56,7 @@ describe('Issues', function () {
|
||||
})
|
||||
it('#277 Passing liquid in FilterImpl', () => {
|
||||
const engine = new Liquid()
|
||||
engine.registerFilter('render', function (template: string, name: string) {
|
||||
engine.registerFilter('render', function (this: any, template: string, name: string) {
|
||||
return this.liquid.parseAndRenderSync(decodeURIComponent(template), { name })
|
||||
})
|
||||
const html = engine.parseAndRenderSync(
|
||||
@@ -65,4 +65,9 @@ describe('Issues', function () {
|
||||
)
|
||||
expect(html).to.equal('hello foo')
|
||||
})
|
||||
it('#288 Unexpected behavior when string literals contain }}', async () => {
|
||||
const engine = new Liquid()
|
||||
const html = await engine.parseAndRender(`{{ '{{' }}{{ '}}' }}`)
|
||||
expect(html).to.equal('{{}}')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user