mirror of
https://github.com/jimeh/fancy_input.git
synced 2026-02-19 03:26:40 +00:00
improved mustache string matching
This commit is contained in:
@@ -299,7 +299,7 @@
|
||||
$.fn.suggest_results.mustache = function(string, data){
|
||||
if (typeof(string) === "string" && typeof(data) === "object") {
|
||||
for (var key in data) {
|
||||
string = string.replace(new RegExp("{{" + key + "}}", "g"), data[key]);
|
||||
string = string.replace(new RegExp("{{\\s*" + key + "\\s*}}", "g"), data[key]);
|
||||
}
|
||||
};
|
||||
return string;
|
||||
|
||||
Reference in New Issue
Block a user