fix(highlights_list): empty results

This commit is contained in:
Elian Doran 2025-12-18 16:18:31 +02:00
parent 57081a1bfb
commit a4024d17ba
No known key found for this signature in database

View File

@ -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);