mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
py nodes, PyAttribute value
This commit is contained in:
parent
2e37c5719d
commit
73ade60654
@ -850,7 +850,11 @@ class PyAttribute(PyObject):
|
||||
|
||||
value = self.options.get('value')
|
||||
if value:
|
||||
signode += addnodes.desc_annotation(value, ' = ' + value)
|
||||
signode += addnodes.desc_annotation(value, '',
|
||||
addnodes.desc_sig_space(),
|
||||
addnodes.desc_sig_punctuation('', '='),
|
||||
addnodes.desc_sig_space(),
|
||||
nodes.Text(value))
|
||||
|
||||
return fullname, prefix
|
||||
|
||||
|
@ -841,7 +841,11 @@ def test_pyattribute(app):
|
||||
[desc_sig_punctuation, "["],
|
||||
[pending_xref, "str"],
|
||||
[desc_sig_punctuation, "]"])],
|
||||
[desc_annotation, " = ''"])],
|
||||
[desc_annotation, (desc_sig_space,
|
||||
[desc_sig_punctuation, '='],
|
||||
desc_sig_space,
|
||||
"''")]
|
||||
)],
|
||||
[desc_content, ()]))
|
||||
assert_node(doctree[1][1][1][0][1][2], pending_xref, **{"py:class": "Class"})
|
||||
assert_node(doctree[1][1][1][0][1][4], pending_xref, **{"py:class": "Class"})
|
||||
|
Loading…
Reference in New Issue
Block a user