Rinser/plugins/fix_scripts.js

14 lines
435 B
JavaScript
Raw Normal View History

module.exports = function (item, itemOptions, source) {
2016-07-05 11:10:18 +00:00
if ((typeof itemOptions.description !== 'undefined') && (itemOptions.description !== null)) {
var match = itemOptions.description.replace(
/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
'');
match = match.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
'');
itemOptions.description = match;
2016-06-15 13:38:21 +00:00
}
return itemOptions;
};