1.4.0 — Text-anchored annotation rewrite
Highlights
- Complete rewrite of the annotation engine: every highlight is now identified by page range + text content instead of fragile DOM Range/Node references.
- Initial highlighting and restore now share the same text-locating pipeline — what can be highlighted can always be restored.
Bug Fixes
- Cross-page highlight could not locate selected text on restore — root cause: per-page restore was matching the full cross-page string against a single page's textLayer, which can never match.
- Same-page highlight occasionally failed when selection overlapped existing highlights — root cause:
collectSegmentsDirectskipped nodes already marked withfleurSel, so an entirely-in-old-highlight selection produced zero segments. compareBoundaryPointsbranch logic was inverted, so the actual start/end offsets were never applied.- Selection endpoints outside the
.pageelement returned immediately — cross-page drag-selection commonly starts from a container-level node.
New
- New command: FleurPDF: 重新渲染当前 PDF 的标注
- New command: FleurPDF: 诊断当前 PDF 结构 (shows page layout, selection page-range, per-page text split in a Notice)
- Five-level in-page text matching with NFKC normalization as fallback when DOM intersection fails
splitAnnotationTextByPagefor restoring cross-page annotations (greedy per-page split: first page = start → page-tail, last page = remainder)
Notes for reviewers
main.jsis now tracked in git (required by Obsidian community plugin review)versions.jsonupdated for 1.4.0 → minAppVersion 1.7.2
Upgrade in Obsidian → Settings → Community plugins → FleurPDF.