0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-08-06 04:37:37 +00:00

Change safeHTML attribute check

This commit is contained in:
G.Ambatte
2026-07-15 21:25:28 +12:00
parent 2eb246ab0d
commit e078f1f6fa
+4 -4
View File
@@ -32,13 +32,13 @@ function safeHTML(htmlString) {
return;
}
// Check remaining elements for blacklisted attributes
for (const attribute of element.attributes){
[...element.attributes].forEach((attribute)=>{
if(blacklistAttrs.some((test)=>{return test(attribute);})) {
element.removeAttribute(attribute.localName);
break;
};
element.removeAttribute(attribute.name);
return;
};
});
});
return div.innerHTML;
};