Fix macOS asset visibility issue
This commit is contained in:
@@ -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){
|
function renderMarkdown(md:markdownit, data:string){
|
||||||
let quotes = ['“', '”', '‘', '’']
|
let quotes = ['“', '”', '‘', '’']
|
||||||
@@ -2278,4 +2283,4 @@ export function parseChatML(data:string):OpenAIChat[]|null{
|
|||||||
content: v
|
content: v
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user