mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #1819 from pjxiao/feature-1793
Fix #1793: Add new line before first item of list
This commit is contained in:
commit
219b5aac9e
@ -711,6 +711,9 @@ class TextTranslator(nodes.NodeVisitor):
|
||||
def _visit_admonition(self, node):
|
||||
self.new_state(2)
|
||||
|
||||
if isinstance(node.children[0], nodes.Sequential):
|
||||
self.add_text(self.nl)
|
||||
|
||||
def _make_depart_admonition(name):
|
||||
def depart_admonition(self, node):
|
||||
self.end_state(first=admonitionlabels[name] + ': ')
|
||||
|
4
tests/roots/test-build-text/listitems.txt
Normal file
4
tests/roots/test-build-text/listitems.txt
Normal file
@ -0,0 +1,4 @@
|
||||
.. seealso::
|
||||
|
||||
* item 1
|
||||
* item 2
|
@ -99,3 +99,15 @@ def test_table_with_empty_cell(app, status, warning):
|
||||
assert lines[4] == "+-------+-------+"
|
||||
assert lines[5] == "| XXX | |"
|
||||
assert lines[6] == "+-------+-------+"
|
||||
|
||||
|
||||
@with_text_app()
|
||||
def test_list_items_in_admonition(app, status, warning):
|
||||
app.builder.build_update()
|
||||
result = (app.outdir / 'listitems.txt').text(encoding='utf-8')
|
||||
lines = [line.rstrip() for line in result.splitlines()]
|
||||
assert lines[0] == "See also:"
|
||||
assert lines[1] == ""
|
||||
assert lines[2] == " * item 1"
|
||||
assert lines[3] == ""
|
||||
assert lines[4] == " * item 2"
|
||||
|
Loading…
Reference in New Issue
Block a user