[feat] sanitize performace
This commit is contained in:
@@ -26,10 +26,9 @@ DOMPurify.addHook("uponSanitizeElement", (node: HTMLElement, data) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
DOMPurify.addHook("uponSanitizeAttribute", (node) => {
|
DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
|
||||||
const style = node.getAttribute("style");
|
if(data.attrName === 'src'){
|
||||||
if(style){
|
data.attrValue = data.attrValue.replace(/(absolute)|(z-index)|(fixed)/g, '')
|
||||||
node.setAttribute('style', style.replace(/(absolute)|(z-index)|(fixed)/g, ''))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user