Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(highlights_list): empty results
Elian Dorana4024d17baa1
diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsxindex be1e170e16..ad634935fd 100644--- a/apps/client/src/widgets/sidebar/HighlightsList.tsx+++ b/apps/client/src/widgets/sidebar/HighlightsList.tsx@@ -137,7 +137,7 @@ function extractHighlightsFromTextEditor(editor: CKTextEditor) {if (!root) return [];for (const { item } of editor.model.createRangeIn(root).getWalker({ ignoreElementEnd: true })) {- if (!item.is('$textProxy')) continue;+ if (!item.is('$textProxy') || !item.data.trim()) continue;const attrs: RawHighlight["attrs"] = {bold: item.hasAttribute('bold'),@@ -198,7 +198,7 @@ function extractHeadingsFromStaticHtml(el: HTMLElement | null) {let node: Node | null;while ((node = walker.nextNode())) {const el = node.parentElement;- if (!el || !node.textContent) continue;+ if (!el || !node.textContent?.trim()) continue;const style = getComputedStyle(el);