[fix] additional assets not working after regex
This commit is contained in:
@@ -59,6 +59,9 @@ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
export async function ParseMarkdown(data:string, char:(character | groupChat) = null, mode:'normal'|'back' = 'normal') {
|
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 && char.type !== 'group'){
|
||||||
if(char.additionalAssets){
|
if(char.additionalAssets){
|
||||||
for(const asset of 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), {
|
return DOMPurify.sanitize(convertor.makeHtml(data), {
|
||||||
ADD_TAGS: ["iframe"],
|
ADD_TAGS: ["iframe"],
|
||||||
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling"],
|
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling"],
|
||||||
|
|||||||
Reference in New Issue
Block a user