[feat] regex flags, fix display
This commit is contained in:
@@ -35,9 +35,6 @@ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
|
||||
|
||||
export async function ParseMarkdown(data:string, char:(character | groupChat) = null, mode:'normal'|'back' = 'normal') {
|
||||
if(char && char.type !== 'group'){
|
||||
if(char.customscript){
|
||||
data = processScript(char, data, 'editdisplay')
|
||||
}
|
||||
if(char.additionalAssets){
|
||||
for(const asset of char.additionalAssets){
|
||||
const assetPath = await getFileSrc(asset[1])
|
||||
@@ -51,6 +48,9 @@ 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"],
|
||||
|
||||
Reference in New Issue
Block a user