fix: match multiline scripts and styles
This commit is contained in:
parent
12476fee42
commit
7e2fed4ed2
1 changed files with 1 additions and 1 deletions
|
|
@ -34,7 +34,7 @@ frappe.dom = {
|
|||
},
|
||||
remove_script_and_style: function(txt) {
|
||||
const evil_tags = ["script", "style", "noscript", "title", "meta", "base", "head"];
|
||||
const regex = new RegExp(evil_tags.map(tag => `<${tag}>.*<\\/${tag}>`).join('|'));
|
||||
const regex = new RegExp(evil_tags.map(tag => `<${tag}>.*<\\/${tag}>`).join('|'), 's');
|
||||
if (!regex.test(txt)) {
|
||||
// no evil tags found, skip the DOM method entirely!
|
||||
return txt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue