fix previous patch
This commit is contained in:
parent
9ab8a95199
commit
082ec7da8d
1 changed files with 6 additions and 2 deletions
|
@ -739,12 +739,16 @@ class MarkDown {
|
||||||
} else {
|
} else {
|
||||||
//console.time();
|
//console.time();
|
||||||
const html = this.makeHTML({keep: true});
|
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
|
//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])) {
|
if (!box.hasChildNodes() || html.isEqualNode(Array.from(box.childNodes)[0])) {
|
||||||
//console.log("no replace needed");
|
//console.log("no replace needed");
|
||||||
} else {
|
} else {
|
||||||
const childChild = Array.from(box.childNodes)[0];
|
if (!(box.childNodes.length === 1 && box.childNodes[0] instanceof Text && condition)) {
|
||||||
if (!childChild || html.isEqualNode(Array.from(childChild.childNodes)[0])) {
|
|
||||||
box.innerHTML = "";
|
box.innerHTML = "";
|
||||||
box.append(html);
|
box.append(html);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue