diff --git a/src/ts/translator/translator.ts b/src/ts/translator/translator.ts index 2464422a..9c8672d7 100644 --- a/src/ts/translator/translator.ts +++ b/src/ts/translator/translator.ts @@ -316,6 +316,7 @@ 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; } @@ -325,12 +326,6 @@ 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; - return; - } // Replace the old node with the new one const newNode = document.createElement( diff --git a/src/ts/util.ts b/src/ts/util.ts index d3ef3dc2..ca3dd7f0 100644 --- a/src/ts/util.ts +++ b/src/ts/util.ts @@ -574,10 +574,12 @@ export function applyMarkdownToNode(node: Node) { span.innerHTML = markdown; // inherit inline style from the parent node - const parentStyle = (node.parentNode as HTMLElement).style; - for(let i=0;i