| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1 1 14 13 1 6 3 2 1 1 | var html_sanitize = require('./sanitizer-bundle.js');
module.exports = function(_) {
if (!_) return '';
return html_sanitize(_, cleanUrl, cleanId);
};
// https://bugzilla.mozilla.org/show_bug.cgi?id=255107
function cleanUrl(url) {
'use strict';
if (/^https?/.test(url.getScheme())) return url.toString();
if (/^mailto?/.test(url.getScheme())) return url.toString();
if ('data' == url.getScheme() && /^image/.test(url.getPath())) {
return url.toString();
}
}
function cleanId(id) { return id; }
|