mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
fix: support comma-separated arguments for static partials, fixes #62
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
const Liquid = require('..')
|
const Liquid = require('..')
|
||||||
const lexical = Liquid.lexical
|
const lexical = Liquid.lexical
|
||||||
const withRE = new RegExp(`with\\s+(${lexical.value.source})`)
|
const withRE = new RegExp(`with\\s+(${lexical.value.source})`)
|
||||||
const staticFileRE = /\S+/
|
const staticFileRE = /[^\s,]+/
|
||||||
const assert = require('../src/util/assert.js')
|
const assert = require('../src/util/assert.js')
|
||||||
|
|
||||||
module.exports = function (liquid) {
|
module.exports = function (liquid) {
|
||||||
|
|||||||
@@ -129,5 +129,15 @@ describe('tags/include', function () {
|
|||||||
return expect(staticLiquid.renderFile('parent.html')).to
|
return expect(staticLiquid.renderFile('parent.html')).to
|
||||||
.eventually.equal('XchildY')
|
.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')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user