fix: support comma-separated arguments for static partials, fixes #62

This commit is contained in:
Jun Yang
2018-04-07 19:45:57 +08:00
parent aa54dad36e
commit 432f878bb6
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
const Liquid = require('..')
const lexical = Liquid.lexical
const withRE = new RegExp(`with\\s+(${lexical.value.source})`)
const staticFileRE = /\S+/
const staticFileRE = /[^\s,]+/
const assert = require('../src/util/assert.js')
module.exports = function (liquid) {
+10
View File
@@ -129,5 +129,15 @@ describe('tags/include', function () {
return expect(staticLiquid.renderFile('parent.html')).to
.eventually.equal('XchildY')
})
it('should support comma separated arguments', function () {
mock({
'/parent.html': 'X{% include child.html, color:"red" %}Y',
'/child.html': 'child with {{color}}'
})
var staticLiquid = new Liquid({dynamicPartials: false, root: '/'})
return expect(staticLiquid.renderFile('parent.html')).to
.eventually.equal('Xchild with redY')
})
})
})