mirror of
https://github.com/jimeh/fancy_input.git
synced 2026-02-19 11:36:41 +00:00
improved mustache string matching
This commit is contained in:
@@ -299,7 +299,7 @@
|
|||||||
$.fn.suggest_results.mustache = function(string, data){
|
$.fn.suggest_results.mustache = function(string, data){
|
||||||
if (typeof(string) === "string" && typeof(data) === "object") {
|
if (typeof(string) === "string" && typeof(data) === "object") {
|
||||||
for (var key in data) {
|
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;
|
return string;
|
||||||
|
|||||||
Reference in New Issue
Block a user