diff options
-rw-r--r-- | sphinx/addnodes.py | 4 | ||||
-rw-r--r-- | sphinx/transforms/post_transforms/__init__.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 5d26643ed..a2fb776e4 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -119,13 +119,13 @@ class toctree(nodes.General, nodes.Element, translatable): # Domain-specific object descriptions (class, function etc.) ############################################################# -class _desc_classes_injector(nodes.TextElement): +class _desc_classes_injector(nodes.Element): """Helper base class for injecting a fixes list of classes. Use as the first base class. """ - classes = [] # type: List[str] + classes: List[str] = [] def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) diff --git a/sphinx/transforms/post_transforms/__init__.py b/sphinx/transforms/post_transforms/__init__.py index bcc9caf00..e2899d994 100644 --- a/sphinx/transforms/post_transforms/__init__.py +++ b/sphinx/transforms/post_transforms/__init__.py @@ -233,7 +233,7 @@ class SigElementFallbackTransform(SphinxPostTransform): node.replace_self(newnode) -class DescSigAddDomainAsClass(SphinxPostTransform): +class PropagateDescDomain(SphinxPostTransform): """Add the domain name of the parent node as a class in each desc_signature node.""" default_priority = 200 @@ -246,7 +246,7 @@ def setup(app: Sphinx) -> Dict[str, Any]: app.add_post_transform(ReferencesResolver) app.add_post_transform(OnlyNodeTransform) app.add_post_transform(SigElementFallbackTransform) - app.add_post_transform(DescSigAddDomainAsClass) + app.add_post_transform(PropagateDescDomain) return { 'version': 'builtin', |