mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #6299: rst:directive directive generates waste space
This commit is contained in:
parent
11a4e47d62
commit
1900c729a3
1
CHANGES
1
CHANGES
@ -79,6 +79,7 @@ Bugs fixed
|
||||
is consisted by non-ASCII characters
|
||||
* #6213: ifconfig: contents after headings are not shown
|
||||
* commented term in glossary directive is wrongly recognized
|
||||
* #6299: rst domain: rst:directive directive generates waste space
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -80,7 +80,10 @@ def parse_directive(d):
|
||||
if not m:
|
||||
return (dir, '')
|
||||
parsed_dir, parsed_args = m.groups()
|
||||
if parsed_args.strip():
|
||||
return (parsed_dir.strip(), ' ' + parsed_args.strip())
|
||||
else:
|
||||
return (parsed_dir.strip(), '')
|
||||
|
||||
|
||||
class ReSTDirective(ReSTMarkup):
|
||||
|
@ -48,8 +48,7 @@ def test_rst_directive(app):
|
||||
text = ".. rst:directive:: .. toctree::"
|
||||
doctree = restructuredtext.parse(app, text)
|
||||
assert_node(doctree, (addnodes.index,
|
||||
[desc, ([desc_signature, ([desc_name, ".. toctree::"],
|
||||
[desc_addname, " "])],
|
||||
[desc, ([desc_signature, desc_name, ".. toctree::"],
|
||||
[desc_content, ()])]))
|
||||
assert_node(doctree[0],
|
||||
entries=[("single", "toctree (directive)", "directive-toctree", "", None)])
|
||||
|
Loading…
Reference in New Issue
Block a user