From 855ea69ec1f3fddfa68dc9f6ca813093cb24c642 Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Thu, 9 Feb 2012 13:06:11 +0100 Subject: [PATCH 1/6] This is a fork of the tag 0.4.0, for maintenance --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 40d50b8..a9994d2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ # mustache.js Changes +## 0.4.0 (1/4/2012) + ## 0.3.1-dev-twitter-b (8/23/2011) * Cached regexes for improved performance From 01d01562e6cc6e05b6b449b73bb0a2ee2a3f9209 Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Thu, 9 Feb 2012 13:10:23 +0100 Subject: [PATCH 2/6] Fix greedy parsing of section name Issue noticed for the transformation of a template for familywall.com, using MustacheJS 0.3.0. In the anonymous function(match,type,name,content) in render_section, the name of the section was incorrectly recognized as: place}}
{{#i18n within a match where the same string is repeated after a / at the end: {{#place}}
{{#i18n}}event.where_event_form{{/i18n}} {{placeId}} {{name}}
{{/place}}
{{#i18n}} This is an unlikely bug, due to the use of the greedy operator + instead of its non-greedy counterpart +?. --- CHANGES.md | 4 ++++ mustache.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a9994d2..fe64aac 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # mustache.js Changes +## 0.4.0-dev-familywall (2/9/2012) + +* fixed greedy parsing of section name in regexp + ## 0.4.0 (1/4/2012) ## 0.3.1-dev-twitter-b (8/23/2011) diff --git a/mustache.js b/mustache.js index 91ec828..feb2913 100644 --- a/mustache.js +++ b/mustache.js @@ -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 From f86e5ca5590347826335b3e74adf6e7326f412fc Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Thu, 9 Feb 2012 13:32:51 +0100 Subject: [PATCH 3/6] Update version number to match previous tag Warning: the tagged version still advertises version "0.4.0". --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index feb2913..c912bd9 100644 --- a/mustache.js +++ b/mustache.js @@ -417,7 +417,7 @@ var Mustache = function () { return({ name: "mustache.js", - version: "0.4.0", + version: "0.4.0-dev-familywall", /* Turns a template and view into HTML From e20cee5f3e102be48e9be0575c71278178190d48 Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Wed, 15 Feb 2012 15:46:24 +0100 Subject: [PATCH 4/6] Use ''' instead of ''', which showed in template output Issue observed during the development of familywall.com, in some conditions. For some reason, using ''' instead fixed the issue. --- mustache.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mustache.js b/mustache.js index c912bd9..74a3e73 100644 --- a/mustache.js +++ b/mustache.js @@ -40,7 +40,7 @@ var Mustache = function () { "<": "<", ">": ">", '"': '"', - "'": ''' + "'": ''' }; function escapeHTML(string) { @@ -417,7 +417,7 @@ var Mustache = function () { return({ name: "mustache.js", - version: "0.4.0-dev-familywall", + version: "0.4.1-dev-familywall", /* Turns a template and view into HTML From 20cc2c6efca0a5d38045f33222dda400f260ba9f Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Wed, 15 Feb 2012 15:53:09 +0100 Subject: [PATCH 5/6] Add tag 0.4.1-dev-familywall --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index fe64aac..c2b8fc6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ # mustache.js Changes +## 0.4.1-dev-familywall (2/15/2012) + ## 0.4.0-dev-familywall (2/9/2012) * fixed greedy parsing of section name in regexp From e94a477e76e930659c5f53f1a3e47abcef09d0c9 Mon Sep 17 00:00:00 2001 From: Eric BRECHEMIER Date: Wed, 15 Feb 2012 16:07:13 +0100 Subject: [PATCH 6/6] Tag as 0.4.1-dev --- CHANGES.md | 4 +--- mustache.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c2b8fc6..eb3c992 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,6 @@ # mustache.js Changes -## 0.4.1-dev-familywall (2/15/2012) - -## 0.4.0-dev-familywall (2/9/2012) +## 0.4.1-dev (2/15/2012) * fixed greedy parsing of section name in regexp diff --git a/mustache.js b/mustache.js index 74a3e73..929f397 100644 --- a/mustache.js +++ b/mustache.js @@ -417,7 +417,7 @@ var Mustache = function () { return({ name: "mustache.js", - version: "0.4.1-dev-familywall", + version: "0.4.1-dev", /* Turns a template and view into HTML