Added a readme file and made a few fixes that were discovered while writing it.
This commit is contained in:
+3
-1
@@ -1,6 +1,7 @@
|
||||
Handlebars = {
|
||||
compile: function(string) {
|
||||
var fnBody = Handlebars.compileFunctionBody(string);
|
||||
console.log(fnBody);
|
||||
return new Function("context", "fallback", fnBody);
|
||||
},
|
||||
|
||||
@@ -22,6 +23,7 @@ Handlebars = {
|
||||
|
||||
escapeText: function(string) {
|
||||
string = string.replace("'", "\\'");
|
||||
string = string.replace("\"", "\\\"");
|
||||
if (string.slice(-1) == "\\") {
|
||||
string = string + "\\";
|
||||
}
|
||||
@@ -38,7 +40,7 @@ Handlebars = {
|
||||
string = "";
|
||||
}
|
||||
|
||||
return string.replace(/&(?!\w+;)|["\\<>]/g, function(str) {
|
||||
return string.toString().replace(/&(?!\w+;)|["\\<>]/g, function(str) {
|
||||
switch(str) {
|
||||
case "&":
|
||||
return "&";
|
||||
|
||||
Reference in New Issue
Block a user