Executed 2026-11-23 · PyMuPDF 1.28.2 · 0 guessed numbers

Nested bookmarks survive a chapter split

The numbers first: 6 bookmarks in (2 top-level chapters, 4 level-2 sub-bookmarks), split by chapter produced 2 chapter files, read back 6/6 with hierarchy intact — all 4 sub-bookmarks kept, every destination verified against page text.

This is the third run in the bookmark series, after the same-page overlap fix and the raw-split 0/10 finding. Today's question: what happens to child bookmarks when their parent chapter becomes its own file?

The executed run

What the hierarchy rule means

A child bookmark is not attached to its parent entry — it is attached to a destination page. When the split puts that page in a chapter file, the child goes with it and keeps its level. The practical check: per-file bookmark counts sum to the source outline (3 + 3 = 6), and no child appears without its parent-level context in the same file.

Not tested here — the list stays honest

Level-3+ depth, a child pointing outside its parent's page range, and bookmark trees in scanned PDFs were not in today's run. The numbers above cover exactly what was executed.