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

Vanessa599d6dfa1fd7
diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts
index 3c4967121f..d2933a2f76 100644
--- a/app/src/protyle/wysiwyg/remove.ts
+++ b/app/src/protyle/wysiwyg/remove.ts
@@ -278,10 +278,9 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
}
let isCallout = blockElement.parentElement.classList.contains("callout-content");
- if (type === "Delete" &&
- (!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
+ if (type === "Delete") {
const bqCaElement = hasClosestByClassName(blockElement, "bq") || hasClosestByClassName(blockElement, "callout");
- if (bqCaElement) {
+ if (bqCaElement && getContenteditableElement(bqCaElement) === getContenteditableElement(blockElement)) {
isCallout = bqCaElement.classList.contains("callout");
blockElement = isCallout ? bqCaElement.querySelector(".callout-content").firstElementChild : bqCaElement.firstElementChild;
}
@@ -342,10 +341,9 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
removeLi(protyle, blockElement, range, type === "Delete");
return;
}
- if (type === "Delete" &&
- (!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
+ if (type === "Delete") {
const liElement = hasClosestByClassName(blockElement, "li");
- if (liElement) {
+ if (liElement && getContenteditableElement(liElement) === getContenteditableElement(blockElement)) {
removeLi(protyle, liElement.firstElementChild.nextElementSibling, range, true);
return;
}