mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
1.9.7
This commit is contained in:
Vendored
+8
-11
@@ -2092,7 +2092,9 @@ module.exports = function (liquid) {
|
||||
if (_.isString(collection) && collection.length > 0) {
|
||||
collection = [collection];
|
||||
} else if (_.isObject(collection)) {
|
||||
collection = Object.keys(collection);
|
||||
collection = Object.keys(collection).map(function (key) {
|
||||
return [key, collection[key]];
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!Array.isArray(collection) || !collection.length) {
|
||||
@@ -2210,7 +2212,6 @@ var withRE = new RegExp('with\\s+(' + lexical.value.source + ')');
|
||||
var assert = require('../src/util/assert.js');
|
||||
|
||||
module.exports = function (liquid) {
|
||||
|
||||
liquid.registerTag('include', {
|
||||
parse: function parse(token) {
|
||||
var match = lexical.value.exec(token.args);
|
||||
@@ -2296,7 +2297,6 @@ var lexical = Liquid.lexical;
|
||||
var assert = require('../src/util/assert.js');
|
||||
|
||||
module.exports = function (liquid) {
|
||||
|
||||
liquid.registerTag('layout', {
|
||||
parse: function parse(token, remainTokens) {
|
||||
var match = lexical.value.exec(token.args);
|
||||
@@ -2314,18 +2314,16 @@ module.exports = function (liquid) {
|
||||
// now register.blocks contains rendered blocks
|
||||
.then(function () {
|
||||
return liquid.getTemplate(layout, register.root);
|
||||
})
|
||||
}).then(function (templates) {
|
||||
// push the hash
|
||||
.then(function (templates) {
|
||||
return scope.push(hash), templates;
|
||||
})
|
||||
scope.push(hash);
|
||||
// render the parent
|
||||
.then(function (templates) {
|
||||
return liquid.renderer.renderTemplates(templates, scope);
|
||||
})
|
||||
// pop the hash
|
||||
.then(function (partial) {
|
||||
return scope.pop(), partial;
|
||||
scope.pop();
|
||||
return partial;
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -2358,9 +2356,8 @@ module.exports = function (liquid) {
|
||||
register.blocks[_this2.block] = partial;
|
||||
return partial;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// if already defined by desendents
|
||||
else {
|
||||
register.blocks[this.block] = html;
|
||||
return Promise.resolve(html);
|
||||
}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liquidjs",
|
||||
"version": "1.9.6",
|
||||
"version": "1.9.7",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liquidjs",
|
||||
"version": "1.9.6",
|
||||
"version": "1.9.7",
|
||||
"description": "A Liquid template engine for Node.js and browsers, with all shopify/liquid features.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user