Make raw blocks operate like blocks

This commit is contained in:
kpdecker
2014-02-09 15:11:12 -06:00
parent 9b14dc40a5
commit 14b7ef9066
5 changed files with 27 additions and 10 deletions
+8 -3
View File
@@ -131,13 +131,18 @@ var AST = {
}
},
RawBlockNode: function(mustache, content, locInfo) {
RawBlockNode: function(mustache, content, close, locInfo) {
LocationInfo.call(this, locInfo);
if (mustache.sexpr.id.original !== close) {
throw new Exception(mustache.sexpr.id.original + " doesn't match " + close, this);
}
content = new AST.ContentNode(content, locInfo);
this.type = 'block';
this.mustache = mustache;
mustache.sexpr.isHelper = mustache.isHelper = true;
mustache.params.splice(0, 0, new AST.StringNode(content, locInfo));
this.program = new AST.ProgramNode([content], locInfo);
},
ContentNode: function(string, locInfo) {