Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9148c0d

Browse filesBrowse files
gh-97740: Fix bang in Sphinx C domain ref target syntax (#97741)
* gh-97740: Fix bang in Sphinx C domain ref target syntax Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> * Add NEWS entry for C domain bang fix Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 19ca114 commit 9148c0d
Copy full SHA for 9148c0d

File tree

Expand file treeCollapse file tree

2 files changed

+17
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+17
-0
lines changed

‎Doc/conf.py

Copy file name to clipboardExpand all lines: Doc/conf.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,18 @@
249249
# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the
250250
# documentation is built with -W (warnings treated as errors).
251251
c_warn_on_allowed_pre_v3 = False
252+
253+
# Fix '!' not working with C domain when pre_v3 is enabled
254+
import sphinx
255+
256+
if sphinx.version_info[:2] < (5, 3):
257+
from sphinx.domains.c import CXRefRole
258+
259+
original_run = CXRefRole.run
260+
261+
def new_run(self):
262+
if self.disabled:
263+
return super(CXRefRole, self).run()
264+
return original_run(self)
265+
266+
CXRefRole.run = new_run
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``!`` in c domain ref target syntax via a ``conf.py`` patch, so it works
2+
as intended to disable ref target resolution.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.