Deze website werkt beter met JavaScript.
Beginscherm
Verkennen
Help
Inloggen
jan
/
mustache.js
kopie van
https://github.com/janl/mustache.js
Volgen
1
Ster
0
Vork
0
Code
Kwesties
0
Publicaties
46
Wiki
Activiteit
Bladeren bron
allow tag-free templates. Closes
http://github.com/janl/mustache.js/issues#issue/9
tags/0.2.2
Jan Lehnardt
16 jaren geleden
bovenliggende
2ff0ce7767
commit
88ddf16cec
4 gewijzigde bestanden
met
toevoegingen van 8
en
1 verwijderingen
Gecombineerde weergave
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-0
examples/empty_template.html
+1
-0
examples/empty_template.js
+1
-0
examples/empty_template.txt
+5
-1
mustache.js
+ 1
- 0
examples/empty_template.html
Bestand weergeven
@@ -0,0 +1 @@
<html><head></head><body><h1>Test</h1></body></html>
+ 1
- 0
examples/empty_template.js
Bestand weergeven
@@ -0,0 +1 @@
var empty_template = {};
+ 1
- 0
examples/empty_template.txt
Bestand weergeven
@@ -0,0 +1 @@
<html><head></head><body><h1>Test</h1></body></html>
+ 5
- 1
mustache.js
Bestand weergeven
@@ -21,7 +21,11 @@ var Mustache = function() {
render: function(template, context, partials, in_recursion) {
render: function(template, context, partials, in_recursion) {
// fail fast
// fail fast
if(template.indexOf(this.otag) == -1) {
if(template.indexOf(this.otag) == -1) {
return template;
if(in_recursion) {
return template;
} else {
this.send(template);
}
}
}
if(!in_recursion) {
if(!in_recursion) {
Schrijf
Voorbeeld
Laden…
Annuleren
Opslaan