[fix] additional assets not working after regex

This commit is contained in:
kwaroran
2023-06-20 12:16:29 +09:00
parent 89015ac009
commit ec9ea4b08d

View File

@@ -59,6 +59,9 @@ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
})
export async function ParseMarkdown(data:string, char:(character | groupChat) = null, mode:'normal'|'back' = 'normal') {
if(char){
data = processScript(char, data, 'editdisplay')
}
if(char && char.type !== 'group'){
if(char.additionalAssets){
for(const asset of char.additionalAssets){
@@ -73,9 +76,6 @@ export async function ParseMarkdown(data:string, char:(character | groupChat) =
}
}
}
if(char){
data = processScript(char, data, 'editdisplay')
}
return DOMPurify.sanitize(convertor.makeHtml(data), {
ADD_TAGS: ["iframe"],
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling"],