Skip to content

Fix RST heading backref hrefs to match docutils auto_id_prefix='id' output#2082

Closed
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-github-actions-test-ruby-3-3
Closed

Fix RST heading backref hrefs to match docutils auto_id_prefix='id' output#2082
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-github-actions-test-ruby-3-3

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown

Summary

Fixes the failing "Test / Ruby 3.3" CI job (check run 84352355754).

Root cause

The auto_id_prefix='id' setting added to rest2html's SETTINGS makes docutils generate TOC backref IDs in id1, id2, ... style (the pre-0.18 default) instead of the new toc-entry-1, toc-entry-2, ... style. Heading elements use <a href="#id*"> to link back to their TOC entry; those href values 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' to SETTINGS (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.

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 AI requested a review from pudiva June 30, 2026 17:43
@pudiva pudiva force-pushed the rst-auto-id-prefix branch 5 times, most recently from 0b012a4 to a5d7bbe Compare June 30, 2026 20:32
Base automatically changed from rst-auto-id-prefix to master July 1, 2026 12:13
@pudiva pudiva closed this Jul 1, 2026
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.

2 participants