diff --git a/client/homebrew/brewRenderer/safeHTML.js b/client/homebrew/brewRenderer/safeHTML.js
index 43828bc1c..378cff9fb 100644
--- a/client/homebrew/brewRenderer/safeHTML.js
+++ b/client/homebrew/brewRenderer/safeHTML.js
@@ -31,14 +31,10 @@ function safeHTML(htmlString) {
return;
}
// Check remaining elements for blacklisted attributes
- if(element.hasAttributes()){
- for (const attribute of element.attributes){
- for (const test of blacklistAttrs) {
- if(test(attribute)){
- element.removeAttribute(attribute.localName);
- break;
- };
- };
+ for (const attribute of element.attributes){
+ if(blacklistAttrs.some((test)=>{return test(attribute);})) {
+ element.removeAttribute(attribute.localName);
+ break;
};
};
});