1 Commits
Author SHA1 Message Date
john-okeefe 9425edb6e9 fix(sync): capture block context across inline splits (drop-caps)
getTextFromXPointer returns a single text node, so a position on
<p><span>C</span>onvergence of Heaven and Earth</p> sent context 'C'.
The server text search matched the first 'C' in the chapter and stored
doc-start, reopening the web reader at the chapter beginning.

When the cleaned node text is tiny (<15 runes), walk up to 3 levels to
enclosing element pointers and return the first block text >=15 runes
(keeping the longest seen as fallback). Kindle-light: at most 3 extra
local reads, only on the tiny-text path, zero extra network. Char-offset
slicing applies to the original node text only, not parent blocks.
2026-09-08 22:32:55 -04:00