diff options
Diffstat (limited to 'sphinx/util/cfamily.py')
-rw-r--r-- | sphinx/util/cfamily.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sphinx/util/cfamily.py b/sphinx/util/cfamily.py index a86cb6f4b..e751ae9bb 100644 --- a/sphinx/util/cfamily.py +++ b/sphinx/util/cfamily.py @@ -1,12 +1,4 @@ -""" - sphinx.util.cfamily - ~~~~~~~~~~~~~~~~~~~ - - Utility functions common to the C and C++ domains. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Utility functions common to the C and C++ domains.""" import re from copy import deepcopy @@ -15,6 +7,7 @@ from typing import Any, Callable, List, Match, Optional, Pattern, Tuple, Union from docutils import nodes from docutils.nodes import TextElement +from sphinx import addnodes from sphinx.config import Config from sphinx.util import logging @@ -134,8 +127,9 @@ class ASTCPPAttribute(ASTAttribute): return "[[" + self.arg + "]]" def describe_signature(self, signode: TextElement) -> None: - txt = str(self) - signode.append(nodes.Text(txt, txt)) + signode.append(addnodes.desc_sig_punctuation('[[', '[[')) + signode.append(nodes.Text(self.arg, self.arg)) + signode.append(addnodes.desc_sig_punctuation(']]', ']]')) class ASTGnuAttribute(ASTBaseBase): |