Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/2911 copy

Vanessaef095fe3d688
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index aad80e8f5a..a2c5699160 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -128,7 +128,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
const key = this.getKey(currentLineValue, protyle.options.hint.extend);
if (typeof key === "undefined" ||
- ( // 除emoji 提示外,其余在 tag/inline math/inline-code 内移动不进行提示
+ ( // 除 emoji 提示外,其余在 tag/inline math/inline-code 内移动不进行提示
this.splitChar !== ":" &&
(protyle.toolbar.getCurrentType(range).length > 0 || hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock"))
)
diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts
index 9eadc4c08d..90ad12ebfa 100644
--- a/app/src/protyle/wysiwyg/enter.ts
+++ b/app/src/protyle/wysiwyg/enter.ts
@@ -285,7 +285,7 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
}
range.extractContents();
const types = protyle.toolbar.getCurrentType(range);
- if (types.includes("inline-code") && range.startContainer.nodeType !== 3) {
+ if (types.includes("code") && range.startContainer.nodeType !== 3) {
// https://github.com/siyuan-note/siyuan/issues/4169
const brElement = document.createElement("br");
(range.startContainer as HTMLElement).after(brElement);
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 4b2f7bd253..f60ac4c7a7 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -218,7 +218,7 @@ export class WYSIWYG {
const tempElement = document.createElement("div");
// https://github.com/siyuan-note/siyuan/issues/5540
const selectTypes = protyle.toolbar.getCurrentType(range);
- if ((selectTypes.length === 1 || range.startContainer.parentElement.parentElement.getAttribute("data-type") === "NodeHeading") &&
+ if ((selectTypes.length > 0 || range.startContainer.parentElement.parentElement.getAttribute("data-type") === "NodeHeading") &&
(
(range.startContainer.nodeType === 3 && range.startContainer.parentElement.textContent === range.toString()) ||
(range.startContainer.nodeType !== 3 && range.startContainer.textContent === range.toString())