🎨 Return document blocks when the keyword search hits different block content https://github.com/siyuan-note/siyuan/issues/10584

This commit is contained in:
Daniel 2024-10-27 10:59:20 +08:00
parent 6021603966
commit 4e407b0ef8
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
15 changed files with 31 additions and 10 deletions

View file

@ -1367,8 +1367,12 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
nextElement.setAttribute("disabled", "disabled");
}
onSearch(response.data.blocks, edit, element, config);
let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
if (response.data.docMode) {
text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
}
searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1}<span class="fn__space"></span>
<span class="ft__on-surface">${window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount)}</span>`;
<span class="ft__on-surface">${text}</span>`;
loadingElement.classList.add("fn__none");
searchResultElement.setAttribute("data-pagecount", response.data.pageCount || 1);
});