diff options
author | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-05-14 20:05:51 +0300 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-05-14 20:07:04 +0300 |
commit | a40f1ad473ee39d0d364b9bd43771d3944f7f2e3 (patch) | |
tree | dfb5fc2bf8f07dddaf084a68786c613b3b0f7263 /sphinx/addnodes.py | |
parent | 63457c700c803ea2a07c72901aca91e9a1a3fa0b (diff) |
Fix astext() for two Sphinx nodes
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 847a6d715..5e191e989 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -112,6 +112,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. @@ -150,6 +157,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.""" |