Fix macOS asset visibility issue

This commit is contained in:
poroyo
2024-11-17 03:07:47 +09:00
parent 78a14eb10c
commit 13fc50eb42

View File

@@ -74,6 +74,11 @@ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
}
})
DOMPurify.addHook('uponSanitizeAttribute', (node, data) => {
if (['IMG', 'SOURCE', 'STYLE'].includes(node.nodeName) && data.attrName === 'src' && data.attrValue.startsWith('asset://localhost/')) {
data.forceKeepAttr = true;
}
});
function renderMarkdown(md:markdownit, data:string){
let quotes = ['“', '”', '', '']
@@ -2278,4 +2283,4 @@ export function parseChatML(data:string):OpenAIChat[]|null{
content: v
}
})
}
}