Skip to content

Commit

Permalink
Fix sphinx-doc#9413: xml: Invalid XML was generated when cross refere…
Browse files Browse the repository at this point in the history
…ncing python objects
  • Loading branch information
tk0miya committed Jan 15, 2022
1 parent 0938c19 commit 46f6d94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -75,6 +75,7 @@ Bugs fixed
* #10015: py domain: types under the "typing" module are not hyperlinked defined
at info-field-list
* #9390: texinfo: Do not emit labels inside footnotes
* #9413: xml: Invalid XML was generated when cross referencing python objects
* #9979: Error level messages were displayed as warning messages
* #10057: Failed to scan documents if the project is placed onto the root
directory
Expand Down
3 changes: 3 additions & 0 deletions sphinx/builders/xml.py
Expand Up @@ -71,6 +71,9 @@ def write_doc(self, docname: str, doctree: Node) -> None:
# work around multiple string % tuple issues in docutils;
# replace tuples in attribute values with lists
doctree = doctree.deepcopy()
for domain in self.env.domains.values():
xmlns = "xmlns:" + domain.name
doctree[xmlns] = "https://www.sphinx-doc.org/"
for node in doctree.findall(nodes.Element):
for att, value in node.attributes.items():
if isinstance(value, tuple):
Expand Down

0 comments on commit 46f6d94

Please sign in to comment.