Skip to content

HTML_TOC: omit the footnotes block - #819

Merged
mattr- merged 1 commit into
vmg:masterfrom
SashaMIT:fix/toc-footnotes
Oct 14, 2026
Merged

mattr- merged 1 commit into
vmg:masterfrom
SashaMIT:fix/toc-footnotes

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

HTML_TOC rendered the footnotes block inside the contents list. A footnote is not a heading.

The TOC renderer no longer sets the footnote callbacks. A footnote body is not parsed when the renderer has no footnote definition callback, so a heading inside a footnote cannot change the list nesting.

A normal HTML render still includes the footnotes block.

Red: the TOC contained <div class="footnotes">. Green: the list is only the heading. bundle exec rake test:unit passed, 151 tests. The conformance suite was not run.

Fixes #815

The table of contents renderer used the HTML footnote callbacks, so a document with footnotes appended the footnotes div inside the list. Those callbacks are not headings, so the TOC renderer leaves them unset. A footnote body is not parsed when nothing is going to render it.
@mattr-

mattr- commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Would love a screenshot of the before and after so I can see how the rendering changes due to this PR.

@SashaMIT

Copy link
Copy Markdown
Contributor Author

Here is the same note, before and after.

HTML_TOC before and after

The footnotes block was sitting inside the Title item. The contents list is only the heading now. The footnote body is empty in that picture because the TOC renderer has no paragraph callback, so the visible change is the rule and the number.

@mattr-

mattr- commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the screenshot! Will merge this as soon as the tests pass.

@mattr-
mattr- merged commit be45edb into vmg:master Oct 14, 2026
10 checks passed
@SashaMIT

Copy link
Copy Markdown
Contributor Author

Thanks for the merge. Glad the picture made the footnotes obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML_TOC option includes footnotes

2 participants