section ticking covers the section

This commit is contained in:
2026-08-27 15:43:00 -04:00
parent 6dcff467d7
commit 8e02235a71
4 changed files with 97 additions and 12 deletions

View File

@@ -244,7 +244,12 @@ class _Builder:
if tag in ('h2', 'h3', 'h4', 'h5'):
text = _inline(node)
if text:
self._add({'type': 'heading', 'text': text})
# The LEVEL travels with it. Without it every heading is a
# sibling, and a reader who ticks a section off crosses out its
# title and nothing underneath - the sub-headings that belong to
# it look untouched, because nothing recorded that they belong.
self._add({'type': 'heading', 'level': int(tag[1]),
'text': text})
return
if tag == 'p':