liquid-node
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -47,25 +47,3 @@ // Generated by CoffeeScript 1.7.1 | ||
return function() { | ||
var Tag, match, tag; | ||
if (Block.IsTag.test(token.value)) { | ||
match = Block.FullToken.exec(token.value); | ||
if (!match) { | ||
throw new Liquid.SyntaxError("Tag '" + token.value + "' was not properly terminated with regexp: " + Liquid.TagEnd.inspect); | ||
} | ||
if (_this.blockDelimiter() === match[1]) { | ||
return _this.endTag(); | ||
} | ||
Tag = _this.template.tags[match[1]]; | ||
if (!Tag) { | ||
return _this.unknownTag(match[1], match[2], tokens); | ||
} | ||
tag = new Tag(_this.template, match[1], match[2]); | ||
_this.nodelist.push(tag); | ||
return tag.parseWithCallbacks(tokens); | ||
} else if (Block.IsVariable.test(token.value)) { | ||
return _this.nodelist.push(_this.createVariable(token)); | ||
} else if (token.value.length === 0) { | ||
} else { | ||
return _this.nodelist.push(token.value); | ||
} | ||
return _this.parseToken(token, tokens); | ||
}; | ||
@@ -91,2 +69,28 @@ })(this))["catch"]((function(_this) { | ||
Block.prototype.parseToken = function(token, tokens) { | ||
var Tag, match, tag; | ||
if (Block.IsTag.test(token.value)) { | ||
match = Block.FullToken.exec(token.value); | ||
if (!match) { | ||
throw new Liquid.SyntaxError("Tag '" + token.value + "' was not properly terminated with regexp: " + Liquid.TagEnd.inspect); | ||
} | ||
if (this.blockDelimiter() === match[1]) { | ||
return this.endTag(); | ||
} | ||
Tag = this.template.tags[match[1]]; | ||
if (!Tag) { | ||
return this.unknownTag(match[1], match[2], tokens); | ||
} | ||
tag = new Tag(this.template, match[1], match[2]); | ||
this.nodelist.push(tag); | ||
return tag.parseWithCallbacks(tokens); | ||
} else if (Block.IsVariable.test(token.value)) { | ||
return this.nodelist.push(this.createVariable(token)); | ||
} else if (token.value.length === 0) { | ||
} else { | ||
return this.nodelist.push(token.value); | ||
} | ||
}; | ||
Block.prototype.endTag = function() { | ||
@@ -93,0 +97,0 @@ return this.ended = true; |
@@ -73,2 +73,10 @@ // Generated by CoffeeScript 1.7.1 | ||
Engine.prototype.parseAndRender = function() { | ||
var args, source; | ||
source = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
return this.parse(source).then(function(template) { | ||
return template.render.apply(template, args); | ||
}); | ||
}; | ||
return Engine; | ||
@@ -75,0 +83,0 @@ |
@@ -15,3 +15,3 @@ { | ||
"description": "Node.js port of Tobias Lütke's Liquid template engine.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"homepage": "https://github.com/sirlantis/liquid-node", | ||
@@ -18,0 +18,0 @@ "bugs": "https://github.com/sirlantis/liquid-node/issues", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
219633
89
1912
0