Make the ID node capable of handling paths

TODO: handle invalid paths in the tokenizer or parser
  TODO: invalidate "{{ foo/ bar }}"
This commit is contained in:
wycats
2010-11-25 16:12:50 -08:00
parent 7d0204bf9f
commit f8b245896d
5 changed files with 31 additions and 10 deletions
+6 -1
View File
@@ -79,7 +79,12 @@ Handlebars.PrintVisitor.prototype.STRING = function(string) {
};
Handlebars.PrintVisitor.prototype.ID = function(id) {
return "ID:" + id.id;
var path = id.id.join("/");
if(id.id.length > 1) {
return "PATH:" + path;
} else {
return "ID:" + path;
}
};
Handlebars.PrintVisitor.prototype.content = function(content) {