Skip to content

Revert "singlehtml: deprecate the 'fix_refuris' helper function (#13037)" - #14241

Open
jayaddison wants to merge 16 commits into
sphinx-doc:masterfrom
jayaddison:issue-14221/singlehtml-restore-fix-refuris
Open

Revert "singlehtml: deprecate the 'fix_refuris' helper function (#13037)"#14241
jayaddison wants to merge 16 commits into
sphinx-doc:masterfrom
jayaddison:issue-14221/singlehtml-restore-fix-refuris

Conversation

@jayaddison

@jayaddison jayaddison commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Purpose

As reported in #14221, the fix_refuris method does appear to prevent duplicate fragment delimiters (the # character) from appearing in the hyperlinks output by the singlehtml builder.

In my opinion we should still consider fix_refuris deprecated -- I'd still like to remove it, since it seems like an unnecessary post-processing of the documents; but additional investigation is required to confirm what it does and whether a better alternative mechanism can be found.

References

Specifically, check for duplication of the HTML anchor fragment
delimiter character (`#`).

Co-authored-by: @etrian-dev
…nx-doc#13037)"

This reverts commit c93723b.

Conflicts:
	CHANGES.rst
	doc/extdev/deprecated.rst
	sphinx/builders/singlehtml.py
@jayaddison

Copy link
Copy Markdown
Contributor Author

Self-quoting:

In my opinion we should still consider fix_refuris deprecated -- I'd still like to remove it, since it seems like an unnecessary post-processing of the documents; but additional investigation is required to confirm what it does and whether a better alternative mechanism can be found.

Please refer to this comment for the results of this investigation: #14221 (comment)

@nvetrini

Copy link
Copy Markdown

Hi,

just checking if there is any feedback on this PR.

Thanks

@kreuzberger

Copy link
Copy Markdown

It would be helpful to fix the singlethml builds for sphinx 9.x therefore 👍 for this PR.
But as long as the checks are failing i think nobody will merge this?

@nvetrini

nvetrini commented Feb 13, 2026

Copy link
Copy Markdown

Hi @kreuzberger . Thank you for the feedback. I might try to fix those if I have time.

For the Python 3.12 check only one failed test, as far as I can see. It has been reported to be unreliable in #14104

@jayaddison

Copy link
Copy Markdown
Contributor Author

This depends on #14240, that is ready for review.

Comment thread sphinx/builders/singlehtml.py Outdated
Comment thread sphinx/builders/singlehtml.py
Comment thread tests/test_builders/test_build_html_refuris.py Outdated
Comment thread tests/roots/test-refuris/ch1.rst Outdated
jayaddison and others added 4 commits August 17, 2026 00:15
Co-authored-by: James Addison <jay@jp-hosting.net>
Duplicate (re)definitions of the same term are not required to
replicate sphinx-doc#14221
Duplicate (re)definitions of the same term are not required to
replicate sphinx-doc#14221
@jayaddison

Copy link
Copy Markdown
Contributor Author

The latest unit test failures (e.g. on cf5af53) seem to relate to HTML encoding differences - single-quotes and double-quotes are no-longer HTMLescaped by Sphinx (to &#39; and &quot; respectively), for example, while the test suite continues to expect that escaping in a few places.

I'm not sure what has caused that behaviour to change, though. Perhaps the Python version used by the GitHub runners has updated with a security fix?

I'll report a CI failure issue, and have some local changes prepared that should fix it -- but it would be good to figure out why it happened.

Comment thread tests/roots/test-refuris/glossary/term1.rst
Comment thread tests/test_builders/test_build_html_refuris.py Outdated
@jdillard jdillard added this to the 9.1.1 milestone Aug 21, 2026

@jdillard jdillard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the last review comment, I don't think I see anything else in the code.

Related: The Purpose section of the PR description is now out of sync with the implementation and says that fix_refuris should remain deprecated.

Comment thread CHANGES.rst Outdated
Co-authored-by: Jared Dillard <jared.dillard+github@gmail.com>

@jdillard jdillard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

Incorrect HTML anchors generated by singlehtml builder

4 participants