Added ability to specify unescaped items with &.
This commit is contained in:
+1
-1
@@ -240,7 +240,7 @@ Handlebars.Compiler.prototype = {
|
||||
} else if(next === "#") {
|
||||
this.openBlock = true;
|
||||
this.getChar();
|
||||
} else if(next === "{") {
|
||||
} else if(next === "{" || next === "&") {
|
||||
this.escaped = false;
|
||||
this.getChar();
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ test("escaping", function() {
|
||||
|
||||
shouldCompileTo("{{awesome}}", {awesome: "&\"\\<>"}, '&\"\\\\<>',
|
||||
"by default expressions should be escaped");
|
||||
|
||||
shouldCompileTo("{{&awesome}}", {awesome: "&\"\\<>"}, '&\"\\<>',
|
||||
"expressions with {{& handlebars aren't escaped");
|
||||
});
|
||||
|
||||
test("functions", function() {
|
||||
|
||||
Reference in New Issue
Block a user