[fix] minor fix
This commit is contained in:
@@ -79,7 +79,7 @@
|
|||||||
translating = false
|
translating = false
|
||||||
translated = false
|
translated = false
|
||||||
}
|
}
|
||||||
if(translateText !== get(DataBase).autoTranslate){
|
if((!translateText) !== (!get(DataBase)?.autoTranslate)){
|
||||||
const marked = await ParseMarkdown(data, charArg, mode, chatID)
|
const marked = await ParseMarkdown(data, charArg, mode, chatID)
|
||||||
translating = true
|
translating = true
|
||||||
const translated = await translateHTML(marked, false)
|
const translated = await translateHTML(marked, false)
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ export async function translateHTML(html: string, reverse:boolean): Promise<stri
|
|||||||
if (node.nodeType === Node.TEXT_NODE) {
|
if (node.nodeType === Node.TEXT_NODE) {
|
||||||
// Translate the text content of the node
|
// Translate the text content of the node
|
||||||
if(node.textContent){
|
if(node.textContent){
|
||||||
console.log(node.nodeName,node.textContent)
|
|
||||||
node.textContent = await translate(node.textContent || '', reverse);
|
node.textContent = await translate(node.textContent || '', reverse);
|
||||||
}
|
}
|
||||||
} else if(node.nodeType === Node.ELEMENT_NODE) {
|
} else if(node.nodeType === Node.ELEMENT_NODE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user