[console] update
This commit is contained in:
@@ -106,7 +106,8 @@
|
||||
} catch (error) {
|
||||
//retry
|
||||
if(tries > 2){
|
||||
alertError(`Error while parsing chat message: ${error}`)
|
||||
|
||||
alertError(`Error while parsing chat message: ${translateText}, ${error.message}`)
|
||||
return data
|
||||
}
|
||||
return await markParsing(data, charArg, mode, chatID, translateText, (tries ?? 0) + 1)
|
||||
|
||||
@@ -52,9 +52,11 @@ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
|
||||
break
|
||||
}
|
||||
case 'class':{
|
||||
if(data.attrValue){
|
||||
data.attrValue = data.attrValue.split(' ').map((v) => {
|
||||
return "x-risu-" + v
|
||||
}).join(' ')
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -180,7 +182,8 @@ function decodeStyle(text:string){
|
||||
if(rule.selectors){
|
||||
for(let i=0;i<rule.selectors.length;i++){
|
||||
let slt:string = rule.selectors[i]
|
||||
let selectors = slt.split(' ').map((v) => {
|
||||
if(slt){
|
||||
let selectors = (slt.split(' ') ?? []).map((v) => {
|
||||
if(v.startsWith('.')){
|
||||
return ".x-risu-" + v.substring(1)
|
||||
}
|
||||
@@ -193,6 +196,7 @@ function decodeStyle(text:string){
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return `<style>${css.stringify(ast)}</style>`
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user