diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-19 22:58:15 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-19 22:58:15 +0900 |
commit | aa1bc83c2ac9357b39048b555c3fdb0efff3449c (patch) | |
tree | c1149670ca18b5f9820505322d5b0a5832395ea4 /sphinx/util/cfamily.py | |
parent | 759a526b12213c59d6ae4c8f66682f4328b764f4 (diff) | |
parent | 017ef6118b4fe588140266ad6ff2393cbddd9137 (diff) | |
download | sphinx-git-aa1bc83c2ac9357b39048b555c3fdb0efff3449c.tar.gz |
Merge branch '4.x'
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): |