Skip to content

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

:art: search

Vanessad5dfa240f590
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 318faf6043..6e9f806d48 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -51,6 +51,7 @@ import {getUnRefList, openSearchUnRef, unRefMoreMenu} from "./unRef";
import {getDefaultType} from "./getDefault";
import {isSupportCSSHL, searchMarkRender} from "../protyle/render/searchMarkRender";
import {saveKeyList, toggleAssetHistory, toggleReplaceHistory, toggleSearchHistory} from "./toggleHistory";
+import {highlightById} from "../util/highlightById";
export const openGlobalSearch = (app: App, text: string, replace: boolean, searchData?: Config.IUILayoutTabSearchConfig) => {
text = text.trim();
@@ -1101,6 +1102,8 @@ export const getArticle = (options: {
searchMarkRender(options.edit.protyle, getResponse.data.keywords, options.id, () => {
if (options.edit.protyle.highlight.ranges.length > 0 && options.edit.protyle.highlight.ranges[options.edit.protyle.highlight.rangeIndex]) {
options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + options.edit.protyle.highlight.ranges[options.edit.protyle.highlight.rangeIndex].getBoundingClientRect().top - contentRect.top - contentRect.height / 2;
+ } else {
+ highlightById(options.edit.protyle, options.id);
}
});
} else {