🎨 最后一个块仅有表情时无法创建新块

This commit is contained in:
Vanessa 2023-02-23 13:37:19 +08:00
parent 52e1cc7957
commit 9db10e36e7

View file

@ -1870,7 +1870,7 @@ export class WYSIWYG {
const lastEditElement = getContenteditableElement(getLastBlock(this.element.lastElementChild));
if (!lastEditElement ||
(this.element.lastElementChild.getAttribute("data-type") !== "NodeParagraph" && protyle.wysiwyg.element.getAttribute("data-doc-type") !== "NodeListItem") ||
(this.element.lastElementChild.getAttribute("data-type") === "NodeParagraph" && getContenteditableElement(lastEditElement).textContent !== "")) {
(this.element.lastElementChild.getAttribute("data-type") === "NodeParagraph" && getContenteditableElement(lastEditElement).innerHTML !== "")) {
const emptyElement = genEmptyElement(false, false);
this.element.insertAdjacentElement("beforeend", emptyElement);
transaction(protyle, [{