mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 04:41:43 +00:00
editor: no se por que falla esto
pero es medio chota la forma en que lo hace así que no me sorprende. igualmente esto no debería pasar.
This commit is contained in:
parent
812f5aab2a
commit
8887932bee
1 changed files with 1 additions and 5 deletions
|
@ -279,13 +279,9 @@ function cleanContent (contentEl) {
|
||||||
child.tagName = "P"
|
child.tagName = "P"
|
||||||
}
|
}
|
||||||
} else if (child.nodeType === Node.TEXT_NODE) {
|
} else if (child.nodeType === Node.TEXT_NODE) {
|
||||||
const wasSelected = sel.getRangeAt(0).intersectsNode(child)
|
|
||||||
|
|
||||||
const el = document.createElement("p")
|
const el = document.createElement("p")
|
||||||
el.appendChild(child)
|
|
||||||
contentEl.insertBefore(el, child.nextSibling)
|
contentEl.insertBefore(el, child.nextSibling)
|
||||||
|
el.appendChild(child)
|
||||||
if (wasSelected) sel.collapse(el, child.data.length)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue