diff --git a/CHANGES.md b/CHANGES.md index e91c38b..c3e69da 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## 0.3.0 (??-??-????) +* Improved whitespace handling. * Make IMPLICIT ITERATORS a first class feature. * Fix Rhino compat. * CommonJS packaging is no longer a special case. diff --git a/examples/array_of_strings.html b/examples/array_of_strings.html index 38fa5ab..2898705 100644 --- a/examples/array_of_strings.html +++ b/examples/array_of_strings.html @@ -1 +1 @@ -{{#array_of_strings}} {{.}} {{/array_of_strings}} \ No newline at end of file +{{#array_of_strings}}{{.}} {{/array_of_strings}} \ No newline at end of file diff --git a/examples/array_of_strings_options.html b/examples/array_of_strings_options.html index 87fbf5e..6b28278 100644 --- a/examples/array_of_strings_options.html +++ b/examples/array_of_strings_options.html @@ -1,2 +1,2 @@ {{%IMPLICIT-ITERATOR iterator=rob}} -{{#array_of_strings_options}} {{rob}} {{/array_of_strings_options}} \ No newline at end of file +{{#array_of_strings_options}}{{rob}} {{/array_of_strings_options}} \ No newline at end of file diff --git a/examples/array_partial.2.html b/examples/array_partial.2.html index c2ea36c..235dd5f 100644 --- a/examples/array_partial.2.html +++ b/examples/array_partial.2.html @@ -1,4 +1,4 @@ Here's a non-sense array of values {{#array}} - {{.}} + {{.}} {{/array}} \ No newline at end of file diff --git a/examples/array_partial.txt b/examples/array_partial.txt index fa87c28..fd5f48e 100644 --- a/examples/array_partial.txt +++ b/examples/array_partial.txt @@ -1,6 +1,6 @@ Here's a non-sense array of values -1 -2 -3 -4 + 1 + 2 + 3 + 4 diff --git a/examples/complex.html b/examples/complex.html index e7ca1b5..23bec3c 100644 --- a/examples/complex.html +++ b/examples/complex.html @@ -2,12 +2,12 @@ {{#list}} {{/list}} diff --git a/examples/complex.txt b/examples/complex.txt index eb78d45..b51ca10 100644 --- a/examples/complex.txt +++ b/examples/complex.txt @@ -1,6 +1,6 @@

Colors

- + diff --git a/examples/partial_recursion.2.html b/examples/partial_recursion.2.html index c002d68..457d2a0 100644 --- a/examples/partial_recursion.2.html +++ b/examples/partial_recursion.2.html @@ -1,4 +1,4 @@ {{name}} {{#children}} - {{>partial}} +{{>partial}} {{/children}} \ No newline at end of file diff --git a/examples/partial_recursion.html b/examples/partial_recursion.html index 8d67c38..d965a6a 100644 --- a/examples/partial_recursion.html +++ b/examples/partial_recursion.html @@ -1,4 +1,4 @@ {{name}} {{#kids}} - {{>partial}} +{{>partial}} {{/kids}} \ No newline at end of file diff --git a/examples/recursion_with_same_names.txt b/examples/recursion_with_same_names.txt index 0f3e1bc..c23bb65 100644 --- a/examples/recursion_with_same_names.txt +++ b/examples/recursion_with_same_names.txt @@ -1,6 +1,6 @@ name desc -t1 + t1 0 -t2 + t2 1 diff --git a/examples/reuse_of_enumerables.txt b/examples/reuse_of_enumerables.txt index c6d5170..6d05d96 100644 --- a/examples/reuse_of_enumerables.txt +++ b/examples/reuse_of_enumerables.txt @@ -1,8 +1,8 @@ -t1 + t1 0 -t2 + t2 1 -t1 + t1 0 -t2 + t2 1 diff --git a/examples/section_as_context.html b/examples/section_as_context.html index 6a39a43..59990f6 100644 --- a/examples/section_as_context.html +++ b/examples/section_as_context.html @@ -3,7 +3,7 @@

{{description}}

{{/a_object}} diff --git a/examples/section_as_context.txt b/examples/section_as_context.txt index 55d4179..53ee336 100644 --- a/examples/section_as_context.txt +++ b/examples/section_as_context.txt @@ -1,6 +1,6 @@ -

this is an object

+

this is an object

one of its attributes is a list

diff --git a/mustache.js b/mustache.js index 80448b1..f3531e7 100644 --- a/mustache.js +++ b/mustache.js @@ -105,7 +105,7 @@ var Mustache = function() { var that = this; // CSW - Added "+?" so it finds the tighest bound, not the widest var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag + - "\\s*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag + + "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag + "\\s*", "mg"); // for each {{#foo}}{{/foo}} section do...