Fix RST heading backref hrefs to match docutils auto_id_prefix='id' output#2082
Draft
Copilot wants to merge 1 commit into
Draft
Fix RST heading backref hrefs to match docutils auto_id_prefix='id' output#2082Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Fix id names changing in rst renders with the upgrade to docutils 0.18 by enforcing the old default value `id` for `auto_id_prefix`. See: https://docutils.sourceforge.io/RELEASE-NOTES.html#release-0-18-2021-10-26 co-authored-by: Tyler Dixon <tylerdixon@github.com>
Copilot created this pull request from a session on behalf of
pudiva
June 30, 2026 17:43
View session
f0c175d to
0b012a4
Compare
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.
Summary
Fixes the failing "Test / Ruby 3.3" CI job (check run 84352355754).
Root cause
The
auto_id_prefix='id'setting added torest2html'sSETTINGSmakes docutils generate TOC backref IDs inid1,id2, ... style (the pre-0.18 default) instead of the newtoc-entry-1,toc-entry-2, ... style. Heading elements use<a href="#id*">to link back to their TOC entry; thosehrefvalues in the fixture files were stale and still pointed to#toc-entry-*, causing the HTML-equality assertion to fail.Changes
Only test fixtures are changed — no production code is modified:
test/markups/README.rst.html— updated 2 heading backref hrefs (#toc-entry-1→#id1,#toc-entry-2→#id2)test/markups/README.long.rst.html— updated 26 heading backref hrefs (#toc-entry-1–#toc-entry-26→#id113–#id138)lib/github/commands/rest2html— adds'auto_id_prefix': 'id'toSETTINGS(keeps the pre-docutils-0.18 ID scheme; intentionally set)Verification
All 24 test cases pass with Ruby 3.3.11 and docutils 0.22.4 after this change.