Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Contributors
* Rui Pinheiro -- Python 3.14 forward references support
* Roland Meister -- epub builder
* Sebastian Wiesner -- image handling, distutils support
* Sidharth Sridhar -- RFC canonical URL fix
* Slawek Figiel -- additional warning suppression
* Stefan Seefeld -- toctree improvements
* Stefan van der Walt -- autosummary extension
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Release 9.1.1 (in development)
Bugs fixed
----------

* #14659: Use the canonical ``https://www.rfc-editor.org/info/`` base URL for
the :rst:role:`rfc` role, instead of
``https://datatracker.ietf.org/doc/html/``.

* #14465: LaTeX: PDF build crash since LaTeX June 2026 release if tables are
styled with ``'colorrows'`` (which is the default).
Patch by Jean-François B.
Expand Down
2 changes: 1 addition & 1 deletion sphinx/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'cloak_email_addresses': True,
'pep_base_url': 'https://peps.python.org/',
'pep_references': None,
'rfc_base_url': 'https://datatracker.ietf.org/doc/html/',
'rfc_base_url': 'https://www.rfc-editor.org/info/',
'rfc_references': None,
'input_encoding': 'utf-8-sig',
'doctitle_xform': False,
Expand Down
4 changes: 2 additions & 2 deletions sphinx/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ def build_uri(self) -> str:
base_url = self.inliner.document.settings.rfc_base_url
ret = self.target.partition('#')
if ret[1]:
return base_url + self.inliner.rfc_url % int(ret[0]) + '#' + ret[2]
return base_url + 'rfc%d/#%s' % (int(ret[0]), ret[2])
else:
return base_url + self.inliner.rfc_url % int(ret[0])
return base_url + 'rfc%d/' % int(ret[0])


def _format_rfc_target(target: str, /) -> str:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_builders/test_build_html_5_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ def checker(nodes: Iterable[Element]) -> Literal[True]:
),
(
'markup.html',
".//a[@href='https://datatracker.ietf.org/doc/html/rfc1.html']"
".//a[@href='https://www.rfc-editor.org/info/rfc1/']"
"[@class='rfc reference external']/strong",
'RFC 1',
),
(
'markup.html',
".//a[@href='https://datatracker.ietf.org/doc/html/rfc1.html']"
".//a[@href='https://www.rfc-editor.org/info/rfc1/']"
"[@class='rfc reference external']/strong",
'Request for Comments #1',
),
Expand Down
8 changes: 4 additions & 4 deletions tests/test_markup/test_markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ def rst_to_latex(rst: str, *, app: SphinxTestApp) -> str:
':rfc:`2324`',
(
'<p><span class="target" id="index-0"></span><a class="rfc reference external" '
'href="https://datatracker.ietf.org/doc/html/rfc2324.html"><strong>RFC 2324</strong></a></p>'
'href="https://www.rfc-editor.org/info/rfc2324/"><strong>RFC 2324</strong></a></p>'
),
(
'\\sphinxAtStartPar\n'
'\\index{RFC@\\spxentry{RFC}!RFC 2324@\\spxentry{RFC 2324}}'
'\\sphinxhref{https://datatracker.ietf.org/doc/html/rfc2324.html}'
'\\sphinxhref{https://www.rfc-editor.org/info/rfc2324/}'
'{\\sphinxstylestrong{RFC 2324}}'
),
),
Expand All @@ -226,13 +226,13 @@ def rst_to_latex(rst: str, *, app: SphinxTestApp) -> str:
':rfc:`2324#section-1`',
(
'<p><span class="target" id="index-0"></span><a class="rfc reference external" '
'href="https://datatracker.ietf.org/doc/html/rfc2324.html#section-1">'
'href="https://www.rfc-editor.org/info/rfc2324/#section-1">'
'<strong>RFC 2324 Section 1</strong></a></p>'
),
(
'\\sphinxAtStartPar\n'
'\\index{RFC@\\spxentry{RFC}!RFC 2324 Section 1@\\spxentry{RFC 2324 Section 1}}'
'\\sphinxhref{https://datatracker.ietf.org/doc/html/rfc2324.html\\#section-1}'
'\\sphinxhref{https://www.rfc-editor.org/info/rfc2324/\\#section-1}'
'{\\sphinxstylestrong{RFC 2324 Section 1}}'
),
),
Expand Down
Loading