in Ox.sanitizeHTML, when passing an array of replaceTags tuples, allow for the second element of that tuple to be a replace function (not just a string)
This commit is contained in:
parent
180b325e30
commit
5227dbc166
1 changed files with 7 additions and 1 deletions
|
@ -517,7 +517,13 @@
|
||||||
var array = replaceTags[tag] || replace[tag] || replace['*'](tag);
|
var array = replaceTags[tag] || replace[tag] || replace['*'](tag);
|
||||||
Ox.forEach(array, function(value) {
|
Ox.forEach(array, function(value) {
|
||||||
html = html.replace(value[0], function() {
|
html = html.replace(value[0], function() {
|
||||||
matches.push(Ox.formatString(value[1], arguments));
|
var match;
|
||||||
|
if (Ox.isFunction(value[1])) {
|
||||||
|
match = value[1].apply(null, arguments);
|
||||||
|
} else {
|
||||||
|
match = Ox.formatString(value[1], arguments);
|
||||||
|
}
|
||||||
|
matches.push(match);
|
||||||
return salt.join(matches.length - 1);
|
return salt.join(matches.length - 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue