diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-17 13:12:56 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-17 13:12:56 +0300 |
commit | 3c7d35d2a20cfa7c915538704680a33db87c0563 (patch) | |
tree | 5c8e1c9e894f90bf18d77c324ab7829fe0c784a6 /sphinx/addnodes.py | |
parent | 4ad466c7a602ca3b60a9cee15a07f84903a28fe8 (diff) | |
parent | 5f51a1e63f9442439466b7acede87ad21d49bdc0 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r-- | sphinx/addnodes.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 42a0faed6..c98cdcbe1 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -109,6 +109,13 @@ class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement): In that case all child nodes must be ``desc_signature_line`` nodes. """ + @property + def child_text_separator(self): + if self.get('is_multiline'): + return ' ' + else: + return super().child_text_separator + class desc_signature_line(nodes.Part, nodes.Inline, nodes.FixedTextElement): """Node for a line in a multi-line object signatures. @@ -147,6 +154,9 @@ class desc_parameterlist(nodes.Part, nodes.Inline, nodes.FixedTextElement): """Node for a general parameter list.""" child_text_separator = ', ' + def astext(self): + return '({})'.format(super().astext()) + class desc_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement): """Node for a single parameter.""" |