Skip to content

Commit 76c9b3c

Browse files
committed
Fix #9413: xml: Invalid XML was generated when cross referencing python objects
1 parent 0938c19 commit 76c9b3c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Bugs fixed
7575
* #10015: py domain: types under the "typing" module are not hyperlinked defined
7676
at info-field-list
7777
* #9390: texinfo: Do not emit labels inside footnotes
78+
* #9413: xml: Invalid XML was generated when cross referencing python objects
7879
* #9979: Error level messages were displayed as warning messages
7980
* #10057: Failed to scan documents if the project is placed onto the root
8081
directory

sphinx/builders/xml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def write_doc(self, docname: str, doctree: Node) -> None:
7171
# work around multiple string % tuple issues in docutils;
7272
# replace tuples in attribute values with lists
7373
doctree = doctree.deepcopy()
74+
for domain in self.env.domains.values():
75+
xmlns = "xmlns:" + domain.name
76+
doctree[xmlns] = "https://www.sphinx-doc.org/" # type: ignore
7477
for node in doctree.findall(nodes.Element):
7578
for att, value in node.attributes.items():
7679
if isinstance(value, tuple):

0 commit comments

Comments
 (0)