diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts index 906da641b..38f263c50 100644 --- a/app/src/protyle/hint/extend.ts +++ b/app/src/protyle/hint/extend.ts @@ -46,7 +46,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => { filter: ["ai chat"], value: Constants.ZWSP + 5, html: '
AI Chat
', - },{ + }, { filter: ["数据库", "视图", "shujuku", "shitu", "sjk", "st", "database", "view", "db"], value: '
', html: `
${window.siyuan.languages.database}
`, @@ -246,7 +246,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => { filter: ["移除样式", "yichuyangshi", "ycys", "remove style"], value: `style${Constants.ZWSP}`, html: `
A
${window.siyuan.languages.clearFontStyle}
`, - },{ + }, { value: "", html: "separator", }]; @@ -352,7 +352,7 @@ export const hintRef = (key: string, protyle: IProtyle, source: THintSource): IH k: key, id: nodeElement ? nodeElement.getAttribute("data-node-id") : protyle.block.parentID, beforeLen: Math.floor((Math.max(protyle.element.clientWidth / 2, 320) - 58) / 28.8), - rootID: protyle.block.rootID, + rootID: source === "av" ? "" : protyle.block.rootID, isSquareBrackets: ["[[", "【【"].includes(protyle.hint.splitChar) }, (response) => { const dataList: IHintData[] = []; diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 72ba693ae..0513dbade 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -305,22 +305,22 @@ ${unicode2Emoji(emoji.unicode)}`; return; } event.stopPropagation(); - this.genSearchHTML(protyle, searchElement, nodeElement, oldValue); + this.genSearchHTML(protyle, searchElement, nodeElement, oldValue, source); }); searchElement.addEventListener("compositionend", (event: InputEvent) => { event.stopPropagation(); - this.genSearchHTML(protyle, searchElement, nodeElement, oldValue); + this.genSearchHTML(protyle, searchElement, nodeElement, oldValue, source); }); } } - private genSearchHTML(protyle: IProtyle, searchElement: HTMLInputElement, nodeElement: false | HTMLElement, oldValue: string) { + private genSearchHTML(protyle: IProtyle, searchElement: HTMLInputElement, nodeElement: false | HTMLElement, oldValue: string, source: THintSource) { this.element.lastElementChild.innerHTML = '
'; fetchPost("/api/search/searchRefBlock", { k: searchElement.value, id: nodeElement ? nodeElement.getAttribute("data-node-id") : protyle.block.parentID, beforeLen: Math.floor((Math.max(protyle.element.clientWidth / 2, 320) - 58) / 28.8), - rootID: protyle.block.rootID, + rootID: source === "av" ? "" : protyle.block.rootID, }, (response) => { let searchHTML = ""; if (response.data.newDoc) {