diff --git a/source/Ox/js/HTML.js b/source/Ox/js/HTML.js index 81eeefb9..c32670b4 100644 --- a/source/Ox/js/HTML.js +++ b/source/Ox/js/HTML.js @@ -40,7 +40,7 @@ img: [ [ /]*?src="((\/|https?:\/\/).+?)".*?>/gi, - '' + '' ] ], rtl: [ @@ -499,9 +499,10 @@ > Ox.sanitizeHTML('') '<http://foo.com>' @*/ - Ox.sanitizeHTML = function(html, tags) { + Ox.sanitizeHTML = function(html, tags, replaceTags) { var matches = []; tags = tags || defaultTags; + replaceTags = replaceTags || {}; // html = Ox.clean(html); fixme: can this be a parameter? if (tags.indexOf('[]') > -1) { html = html.replace( @@ -513,7 +514,7 @@ }); } tags.forEach(function(tag) { - var array = replace[tag] || replace['*'](tag); + var array = replaceTags[tag] || replace[tag] || replace['*'](tag); Ox.forEach(array, function(value) { html = html.replace(value[0], function() { matches.push(Ox.formatString(value[1], arguments));