From a4024d17baa1b81cf1c2b22be23c3bebe9f08e61 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 18 Dec 2025 16:18:31 +0200 Subject: [PATCH] fix(highlights_list): empty results --- apps/client/src/widgets/sidebar/HighlightsList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsx index be1e170e1..ad634935f 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);