fix assign tag regex to include linebreaks in value

This commit is contained in:
Andrew Barclay
2018-11-22 09:31:22 +08:00
committed by Jun Yang
parent d65ea14b9f
commit 2055258193
9 changed files with 1118 additions and 1134 deletions
+8
View File
@@ -41,6 +41,14 @@ describe('tags/assign', function () {
return expect(liquid.parseAndRender(src))
.to.eventually.equal('A')
})
it('should assign as filter across multiple lines as result', function () {
const src = `{% assign foo="a b"
| capitalize
| split: " "
| first %}{{foo}}`
return expect(liquid.parseAndRender(src))
.to.eventually.equal('A')
})
it('should assign var-1', function () {
const src = '{% assign var-1 = 5 %}{{ var-1 }}'
return expect(liquid.parseAndRender(src)).to.eventually.equal('5')