From 082ec7da8d01f3d9b3d8b18a7fdecf2fdc622342 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Sat, 15 Mar 2025 15:12:31 -0500 Subject: [PATCH] fix previous patch --- src/webpage/markdown.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/webpage/markdown.ts b/src/webpage/markdown.ts index 536388b..7593caf 100644 --- a/src/webpage/markdown.ts +++ b/src/webpage/markdown.ts @@ -739,12 +739,16 @@ class MarkDown { } else { //console.time(); const html = this.makeHTML({keep: true}); + const condition = + html.childNodes.length == 1 && + html.childNodes[0].childNodes.length === 1 && + html.childNodes[0].childNodes[0]; + console.log(box.cloneNode(true), html.cloneNode(true)); //TODO this may be slow, may want to check in on this in the future if it is if (!box.hasChildNodes() || html.isEqualNode(Array.from(box.childNodes)[0])) { //console.log("no replace needed"); } else { - const childChild = Array.from(box.childNodes)[0]; - if (!childChild || html.isEqualNode(Array.from(childChild.childNodes)[0])) { + if (!(box.childNodes.length === 1 && box.childNodes[0] instanceof Text && condition)) { box.innerHTML = ""; box.append(html); } else {