Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/11225

Vanessafc20b887d5ae
diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.ts
index 348e255f98..26e5301850 100644
--- a/app/src/protyle/wysiwyg/remove.ts
+++ b/app/src/protyle/wysiwyg/remove.ts
@@ -171,15 +171,15 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
hideElements(["util"], protyle);
return;
}
+ const blockType = blockElement.getAttribute("data-type")
// 空代码块直接删除
- if (blockElement.getAttribute("data-type") === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") {
+ if (blockType === "NodeCodeBlock" && getContenteditableElement(blockElement).textContent.trim() === "") {
blockElement.classList.add("protyle-wysiwyg--select");
removeBlock(protyle, blockElement, range, type);
return;
}
// 设置 bq 和代码块光标
- if (blockElement.getAttribute("data-type") === "NodeCodeBlock" ||
- blockElement.getAttribute("data-type") === "NodeTable") {
+ if (["NodeCodeBlock", "NodeTable", "NodeAttributeView"].includes(blockType)) {
if (blockElement.previousElementSibling) {
focusBlock(blockElement.previousElementSibling, undefined, false);
}
@@ -230,7 +230,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: Ran
removeLi(protyle, blockElement, range, type === "Delete");
return;
}
- if (blockElement.getAttribute("data-type") === "NodeHeading") {
+ if (blockType === "NodeHeading") {
turnsIntoTransaction({
protyle: protyle,
selectsElement: [blockElement],