Bladeren bron

don't make the thing a multi-line

tags/0.4.0
Ben Cherry 15 jaren geleden
bovenliggende
commit
2fc2b8c0d0
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js Bestand weergeven

@@ -150,7 +150,7 @@ var Mustache = function() {
var that = this; var that = this;
var regex = new RegExp("(?:^([\\s\\S]*?))?" + this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag + var regex = new RegExp("(?:^([\\s\\S]*?))?" + this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
"\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\3\\s*" + this.ctag + "\\s*" + "\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\3\\s*" + this.ctag + "\\s*" +
"([\\s\\S]*?)(?=(?:" + this.otag + "(?:\\^|\\#)\\s*(?:.+)\\s*" + this.ctag + ")|$)", "mg");
"([\\s\\S]*?)(?=(?:" + this.otag + "(?:\\^|\\#)\\s*(?:.+)\\s*" + this.ctag + ")|$)", "g");


// for each {{#foo}}{{/foo}} section do... // for each {{#foo}}{{/foo}} section do...
return template.replace(regex, function(match, before, type, name, content, after) { return template.replace(regex, function(match, before, type, name, content, after) {


Laden…
Annuleren
Opslaan