diff --git a/apps/desktop/src/lib/selection-copy-colors.test.ts b/apps/desktop/src/lib/selection-copy-colors.test.ts index a7ceab5e2e..4faca83f91 100644 --- a/apps/desktop/src/lib/selection-copy-colors.test.ts +++ b/apps/desktop/src/lib/selection-copy-colors.test.ts @@ -167,6 +167,7 @@ describe('serializeSelectionStructure', () => { const host = armSelection( '
plain prose
' ) + const html = serializeSelectionStructure(window.getSelection()!, document) // Generic family on the wrapper: resolves to each platform's own face, diff --git a/apps/desktop/src/lib/selection-copy-colors.ts b/apps/desktop/src/lib/selection-copy-colors.ts index 944c4073ed..13a303b9d2 100644 --- a/apps/desktop/src/lib/selection-copy-colors.ts +++ b/apps/desktop/src/lib/selection-copy-colors.ts @@ -174,6 +174,7 @@ export function selectionInkLuma(sel: Selection, doc: Document): number | null { for (let i = 0; i < sel.rangeCount && lumas.length < MAX_PROBE_NODES; i++) { const range = sel.getRangeAt(i) const root = range.commonAncestorContainer + const walker = doc.createTreeWalker( root.nodeType === 1 ? root : (root.parentElement ?? doc.body), NodeFilter.SHOW_TEXT