0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-06 03:32:40 +00:00

Exclude tags in FORBID_TAGS

This commit is contained in:
G.Ambatte
2024-07-01 09:35:48 +12:00
parent fa4ced0592
commit acb10d7695

View File

@@ -177,7 +177,7 @@ const BrewRenderer = (props)=>{
const frameDidMount = ()=>{ //This triggers when iFrame finishes internal "componentDidMount" const frameDidMount = ()=>{ //This triggers when iFrame finishes internal "componentDidMount"
DOMPurify.addHook('uponSanitizeElement', (node, data, config)=>{ DOMPurify.addHook('uponSanitizeElement', (node, data, config)=>{
const tagName = node.tagName?.toLowerCase(); const tagName = node.tagName?.toLowerCase();
data.allowedTags[tagName] = true; if(!config.FORBID_TAGS?.includes(tagName)){ data.allowedTags[tagName] = true; }
}); });
setTimeout(()=>{ //We still see a flicker where the style isn't applied yet, so wait 100ms before showing iFrame setTimeout(()=>{ //We still see a flicker where the style isn't applied yet, so wait 100ms before showing iFrame