Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/18130

Vanessa00b1656396c0
diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts
index 1aecaf531a..49c12604b7 100644
--- a/app/src/protyle/wysiwyg/remove.ts
+++ b/app/src/protyle/wysiwyg/remove.ts
@@ -1,6 +1,6 @@
import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
import {
- getContenteditableElement, getFirstBlock,
+ getContenteditableElement,
getLastBlock,
getNextBlock,
getParentBlock,
@@ -343,7 +343,11 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
const blockParentElement = isCallout ? blockElement.parentElement.parentElement : blockElement.parentElement;
if (!blockElement.previousElementSibling && (blockElement.parentElement.getAttribute("data-type") === "NodeBlockquote" || isCallout) && (
(type !== "Delete" && blockType !== "NodeHeading") ||
- (type === "Delete" && blockParentElement.parentElement.classList.contains("protyle-wysiwyg"))
+ (type === "Delete" && (
+ blockParentElement.parentElement.classList.contains("protyle-wysiwyg") ||
+ blockParentElement.parentElement.classList.contains("li") ||
+ blockParentElement.parentElement.classList.contains("sb")
+ ))
)) {
if (type !== "Delete") {
range.insertNode(document.createElement("wbr"));