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

Vanessa559ef4aae7c4
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 61ad3f1265..d95c4457fd 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -689,7 +689,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
// https://github.com/siyuan-note/siyuan/issues/5547
const previousSibling = hasPreviousSibling(range.startContainer) as HTMLElement;
if (range.startOffset === 1 && range.startContainer.textContent === Constants.ZWSP &&
- previousSibling && previousSibling.nodeType !== 3) {
+ previousSibling && previousSibling.nodeType !== 3 &&
+ event.key === "Backspace" // https://github.com/siyuan-note/siyuan/issues/6786
+ ) {
if (previousSibling.classList.contains("img")) {
previousSibling.classList.add("img--select");
} else if (previousSibling.getAttribute("data-type")?.indexOf("inline-math") > -1) {