mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 10:12:41 +00:00
Simplify logic & reduce nesting
This commit is contained in:
@@ -31,14 +31,10 @@ function safeHTML(htmlString) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check remaining elements for blacklisted attributes
|
// Check remaining elements for blacklisted attributes
|
||||||
if(element.hasAttributes()){
|
for (const attribute of element.attributes){
|
||||||
for (const attribute of element.attributes){
|
if(blacklistAttrs.some((test)=>{return test(attribute);})) {
|
||||||
for (const test of blacklistAttrs) {
|
element.removeAttribute(attribute.localName);
|
||||||
if(test(attribute)){
|
break;
|
||||||
element.removeAttribute(attribute.localName);
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user