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

Vanessa4d32146dca7b
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 6feef09f58..b1dd6e9eac 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1311,12 +1311,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
// toolbar action
if (matchHotKey(window.siyuan.config.keymap.editor.insert.lastUsed.custom, event)) {
protyle.toolbar.range = range;
- let selectElements: Element[] = [];
- if (selectText === "" && protyle.toolbar.getCurrentType(range).length === 0) {
- selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
- if (selectElements.length === 0) {
- selectElements = [nodeElement];
- }
+ const selectElements: Element[] = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));
+ if (selectText === "" && selectElements.length === 0) {
+ selectElements.push(nodeElement);
}
fontEvent(protyle, selectElements);
event.stopPropagation();