Przeglądaj źródła

ctemplate / mustache compat: partials now use >, not <

tags/0.2
Jan Lehnardt 16 lat temu
rodzic
commit
176b0111fe
3 zmienionych plików z 4 dodań i 4 usunięć
  1. +1
    -1
      examples/template_partial.html
  2. +1
    -1
      examples/view_partial.html
  3. +2
    -2
      mustache.js

+ 1
- 1
examples/template_partial.html Wyświetl plik

@@ -1,2 +1,2 @@
<h1>{{title}}</h1>
{{<partial}}
{{>partial}}

+ 1
- 1
examples/view_partial.html Wyświetl plik

@@ -1,3 +1,3 @@
<h1>{{greeting}}</h1>
{{<partial}}
{{>partial}}
<h3>{{farewell}}</h3>

+ 2
- 2
mustache.js Wyświetl plik

@@ -73,7 +73,7 @@ var Mustache = function() {
var lines = template.split("\n");

var new_regex = function() {
return new RegExp(that.otag + "(=|!|<|\\{)?([^\/#]+?)\\1?" +
return new RegExp(that.otag + "(=|!|>|\\{)?([^\/#]+?)\\1?" +
that.ctag + "+", "g");
};

@@ -93,7 +93,7 @@ var Mustache = function() {
// on the same line
i--;
return "";
case "<": // render partial
case ">": // render partial
return that.render_partial(name, context, partials);
case "{": // the triple mustache is unescaped
return that.find(name, context);


Ładowanie…
Anuluj
Zapisz