Skip to content

Commit 83630e9

Browse files
committed
Domain, more precise contnode type
1 parent 09a0370 commit 83630e9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sphinx/domains/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Type, Union, cast)
1616

1717
from docutils import nodes
18-
from docutils.nodes import Element, Node, system_message
18+
from docutils.nodes import Element, Node, TextElement, system_message
1919
from docutils.parsers.rst.states import Inliner
2020

2121
from sphinx.addnodes import pending_xref
@@ -317,7 +317,7 @@ def process_field_xref(self, pnode: pending_xref) -> None:
317317
pass
318318

319319
def resolve_xref(self, env: "BuildEnvironment", fromdocname: str, builder: "Builder",
320-
typ: str, target: str, node: pending_xref, contnode: Element
320+
typ: str, target: str, node: pending_xref, contnode: TextElement
321321
) -> Element:
322322
"""Resolve the pending_xref *node* with the given *typ* and *target*.
323323
@@ -335,7 +335,7 @@ def resolve_xref(self, env: "BuildEnvironment", fromdocname: str, builder: "Buil
335335
pass
336336

337337
def resolve_any_xref(self, env: "BuildEnvironment", fromdocname: str, builder: "Builder",
338-
target: str, node: pending_xref, contnode: Element
338+
target: str, node: pending_xref, contnode: TextElement
339339
) -> List[Tuple[str, Element]]:
340340
"""Resolve the pending_xref *node* with the given *target*.
341341

sphinx/transforms/post_transforms/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import Any, Dict, List, Optional, Tuple, Type, cast
1212

1313
from docutils import nodes
14-
from docutils.nodes import Element
14+
from docutils.nodes import Element, TextElement
1515

1616
from sphinx import addnodes
1717
from sphinx.addnodes import pending_xref
@@ -117,7 +117,8 @@ def run(self, **kwargs: Any) -> None:
117117

118118
node.replace_self(newnodes)
119119

120-
def resolve_anyref(self, refdoc: str, node: pending_xref, contnode: Element) -> Element:
120+
def resolve_anyref(self, refdoc: str,
121+
node: pending_xref, contnode: TextElement) -> Element:
121122
"""Resolve reference generated by the "any" role."""
122123
stddomain = self.env.get_domain('std')
123124
target = node['reftarget']

0 commit comments

Comments
 (0)