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/16895

Vanessaaef26a743ada
diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts
index a3de32fcff..3c4967121f 100644
--- a/app/src/protyle/wysiwyg/remove.ts
+++ b/app/src/protyle/wysiwyg/remove.ts
@@ -1,4 +1,10 @@
-import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
+import {
+ focusBlock,
+ focusByRange,
+ focusByWbr,
+ getSelectionOffset,
+ setLastNodeRange
+} from "../util/selection";
import {
getContenteditableElement,
getLastBlock,
@@ -272,7 +278,8 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
}
let isCallout = blockElement.parentElement.classList.contains("callout-content");
- if (type === "Delete") {
+ if (type === "Delete" &&
+ (!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
const bqCaElement = hasClosestByClassName(blockElement, "bq") || hasClosestByClassName(blockElement, "callout");
if (bqCaElement) {
isCallout = bqCaElement.classList.contains("callout");
@@ -335,7 +342,8 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
removeLi(protyle, blockElement, range, type === "Delete");
return;
}
- if (type === "Delete") {
+ if (type === "Delete" &&
+ (!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
const liElement = hasClosestByClassName(blockElement, "li");
if (liElement) {
removeLi(protyle, liElement.firstElementChild.nextElementSibling, range, true);