diff --git a/CHANGES.md b/CHANGES.md index 40d50b8..eb3c992 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # mustache.js Changes +## 0.4.1-dev (2/15/2012) + +* fixed greedy parsing of section name in regexp + +## 0.4.0 (1/4/2012) + ## 0.3.1-dev-twitter-b (8/23/2011) * Cached regexes for improved performance diff --git a/mustache.js b/mustache.js index 91ec828..929f397 100644 --- a/mustache.js +++ b/mustache.js @@ -40,7 +40,7 @@ var Mustache = function () { "<": "<", ">": ">", '"': '"', - "'": ''' + "'": ''' }; function escapeHTML(string) { @@ -176,7 +176,7 @@ var Mustache = function () { "^([\\s\\S]*?)" + // all the crap at the beginning that is not {{*}} ($1) otag + // {{ - "(\\^|\\#)\\s*(.+)\\s*" + // #foo (# == $2, foo == $3) + "(\\^|\\#)\\s*(.+?)\\s*" +// #foo (# == $2, foo == $3), not greedy ctag + // }} "\n*([\\s\\S]*?)" + // between the tag ($2). leading newlines are dropped @@ -417,7 +417,7 @@ var Mustache = function () { return({ name: "mustache.js", - version: "0.4.0", + version: "0.4.1-dev", /* Turns a template and view into HTML