Skip to content

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

fix: 在行级标签上选择文本时不打开搜索 (#13976)

Jeffrey Chen7f9d00fbf1a2
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index faae12fa8f..671e6478e3 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -2388,7 +2388,7 @@ export class WYSIWYG {
}
const tagElement = hasClosestByAttribute(event.target, "data-type", "tag");
- if (tagElement && !event.altKey && !event.shiftKey) {
+ if (tagElement && !event.altKey && !event.shiftKey && range.toString() === "") {
/// #if !MOBILE
openGlobalSearch(protyle.app, `#${tagElement.textContent}#`, !ctrlIsPressed, {method: 0});
hideElements(["dialog"]);