diff --git a/src/ts/translator/translator.ts b/src/ts/translator/translator.ts index 9c8672d7..aaa1bb25 100644 --- a/src/ts/translator/translator.ts +++ b/src/ts/translator/translator.ts @@ -316,7 +316,6 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl let translated = await translate(node.textContent || "", reverse); if (!reprocessDisplayScript) { node.textContent = translated; - applyMarkdownToNode(node); return; } @@ -326,6 +325,12 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl "editdisplay", chatID ); + // If the translation is the same, don't replace the node + if (translated == processedTranslated) { + node.textContent = processedTranslated; + applyMarkdownToNode(node) + return; + } // Replace the old node with the new one const newNode = document.createElement(