Browse Source

better whitspacing, closes #41

tags/0.3.0
Jan Lehnardt 16 years ago
parent
commit
e4ab54d524
14 changed files with 32 additions and 31 deletions
  1. +1
    -0
      CHANGES.md
  2. +1
    -1
      examples/array_of_strings.html
  3. +1
    -1
      examples/array_of_strings_options.html
  4. +1
    -1
      examples/array_partial.2.html
  5. +4
    -4
      examples/array_partial.txt
  6. +6
    -6
      examples/complex.html
  7. +5
    -5
      examples/complex.txt
  8. +1
    -1
      examples/partial_recursion.2.html
  9. +1
    -1
      examples/partial_recursion.html
  10. +2
    -2
      examples/recursion_with_same_names.txt
  11. +4
    -4
      examples/reuse_of_enumerables.txt
  12. +1
    -1
      examples/section_as_context.html
  13. +3
    -3
      examples/section_as_context.txt
  14. +1
    -1
      mustache.js

+ 1
- 0
CHANGES.md View File

@@ -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.


+ 1
- 1
examples/array_of_strings.html View File

@@ -1 +1 @@
{{#array_of_strings}} {{.}} {{/array_of_strings}}
{{#array_of_strings}}{{.}} {{/array_of_strings}}

+ 1
- 1
examples/array_of_strings_options.html View File

@@ -1,2 +1,2 @@
{{%IMPLICIT-ITERATOR iterator=rob}}
{{#array_of_strings_options}} {{rob}} {{/array_of_strings_options}}
{{#array_of_strings_options}}{{rob}} {{/array_of_strings_options}}

+ 1
- 1
examples/array_partial.2.html View File

@@ -1,4 +1,4 @@
Here's a non-sense array of values
{{#array}}
{{.}}
{{.}}
{{/array}}

+ 4
- 4
examples/array_partial.txt View File

@@ -1,6 +1,6 @@
Here's a non-sense array of values
1
2
3
4
1
2
3
4


+ 6
- 6
examples/complex.html View File

@@ -2,12 +2,12 @@
{{#list}}
<ul>
{{#item}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{#link}}
<li><a href="{{url}}">{{name}}</a></li>
{{/link}}
{{#current}}
<li><strong>{{name}}</strong></li>
{{/current}}
{{#link}}
<li><a href="{{url}}">{{name}}</a></li>
{{/link}}
{{/item}}
</ul>
{{/list}}


+ 5
- 5
examples/complex.txt View File

@@ -1,6 +1,6 @@
<h1>Colors</h1>
<ul>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
</ul>
<ul>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
</ul>

+ 1
- 1
examples/partial_recursion.2.html View File

@@ -1,4 +1,4 @@
{{name}}
{{#children}}
{{>partial}}
{{>partial}}
{{/children}}

+ 1
- 1
examples/partial_recursion.html View File

@@ -1,4 +1,4 @@
{{name}}
{{#kids}}
{{>partial}}
{{>partial}}
{{/kids}}

+ 2
- 2
examples/recursion_with_same_names.txt View File

@@ -1,6 +1,6 @@
name
desc
t1
t1
0
t2
t2
1

+ 4
- 4
examples/reuse_of_enumerables.txt View File

@@ -1,8 +1,8 @@
t1
t1
0
t2
t2
1
t1
t1
0
t2
t2
1

+ 1
- 1
examples/section_as_context.html View File

@@ -3,7 +3,7 @@
<p>{{description}}</p>
<ul>
{{#a_list}}
<li>{{label}}</li>
<li>{{label}}</li>
{{/a_list}}
</ul>
{{/a_object}}

+ 3
- 3
examples/section_as_context.txt View File

@@ -1,6 +1,6 @@
<h1>this is an object</h1>
<h1>this is an object</h1>
<p>one of its attributes is a list</p>
<ul>
<li>listitem1</li>
<li>listitem2</li>
<li>listitem1</li>
<li>listitem2</li>
</ul>

+ 1
- 1
mustache.js View File

@@ -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...


Loading…
Cancel
Save