Skip to content

Commit 9ab8a95

Browse files
committed
fix mobile MarkDown bug
1 parent cf82065 commit 9ab8a95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/webpage/markdown.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,13 @@ class MarkDown {
743743
if (!box.hasChildNodes() || html.isEqualNode(Array.from(box.childNodes)[0])) {
744744
//console.log("no replace needed");
745745
} else {
746-
box.innerHTML = "";
747-
box.append(html);
746+
const childChild = Array.from(box.childNodes)[0];
747+
if (!childChild || html.isEqualNode(Array.from(childChild.childNodes)[0])) {
748+
box.innerHTML = "";
749+
box.append(html);
750+
} else {
751+
//console.log("empty replace not happened");
752+
}
748753
}
749754
//console.timeEnd();
750755
}

0 commit comments

Comments
 (0)