Conversation
This PR restores missing `id` anchors on manual title pages and split chapter pages. We now emit each registered section ID on its heading, matching the existing behavior for sections rendered when in single-page output mode.
For example, render this Verso manual with `htmlDepth := 1`:
```lean
#docs (Manual) doc "Example" :=
:::::::
See {ref "tagged-chapter"}[the chapter].
# Tagged Chapter
%%%
tag := "tagged-chapter"
%%%
Chapter content.
:::::::
```
The reference points to `/Tagged-Chapter/#tagged-chapter`. Previously, the split-page renderer constructed its own heading without the ID. The relevant HTML changes as follows (simplified):
```diff
<section>
- <h1>...</h1>
+ <h1 id="tagged-chapter">...</h1>
...
</section>
```
The link now resolves to the chapter heading correctly.
Title pages have the same missing-anchor problem, including in single-page output.
We now share the anchor, numbering, and permalink construction through a `partHeading` helper, used by ordinary sections, split chapters, and title pages. The helper represents the result as a `Heading` with explicit level, optional ID, and content, and render it through `Heading.toHtml`.
Breaking change: `Html.titlePage` now takes a `Heading` as its first argument. Callers passing plain title HTML must instead supply a heading with its level, ID, and content; manual renderers can use `partHeading` to obtain the registered anchor and existing numbering/permalink behavior.
Codex with GPT-6 was used to prepare this PR.
ejgallego
force-pushed
the
fix/split-page-section-anchors-main
branch
from
September 12, 2026 15:30
c64479e to
5ac8de3
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR restores missing
idanchors on manual title pages and split chapter pages. We now emit each registered section ID on its heading, matching the existing behavior for sections rendered when in single-page output mode.For example, render this Verso manual with
htmlDepth := 1:The reference points to
/Tagged-Chapter/#tagged-chapter. Previously, the split-page renderer constructed its own heading without the ID. The relevant HTML changes as follows (simplified):The link now resolves to the chapter heading correctly.
Title pages have the same missing-anchor problem, including in single-page output.
We now share the anchor, numbering, and permalink construction through a
partHeadinghelper, used by ordinary sections, split chapters, and title pages. The helper represents the result as aHeadingwith explicit level, optional ID, and content, and render it throughHeading.toHtml.Breaking change:
Html.titlePagenow takes aHeadingas its first argument. Callers passing plain title HTML must instead supply a heading with its level, ID, and content; manual renderers can usepartHeadingto obtain the registered anchor and existing numbering/permalink behavior.Codex with GPT-6 was used to prepare this PR.