summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-05-06 21:27:43 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-05-06 21:27:43 +0900
commitdc1c5fee702ec4537d31823cc87fc3bb13e00767 (patch)
tree612eba2690580267b6a70455fef00b6311225df2
parenta9b3ec532276b7dc0ef35273177a1c6716796d73 (diff)
downloadsphinx-git-dc1c5fee702ec4537d31823cc87fc3bb13e00767.tar.gz
Fix #6331: man: invalid output when doctest follows rubric
-rw-r--r--CHANGES1
-rw-r--r--sphinx/writers/manpage.py2
-rw-r--r--tests/test_build_manpage.py7
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index e9ba00d96..57c18836d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -94,6 +94,7 @@ Bugs fixed
* #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
+* #6331: man: invalid output when doctest follows rubric
Testing
--------
diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py
index 0856ee5ee..7811ccc5b 100644
--- a/sphinx/writers/manpage.py
+++ b/sphinx/writers/manpage.py
@@ -282,7 +282,7 @@ class ManualPageTranslator(SphinxTranslator, BaseTranslator):
def depart_rubric(self, node):
# type: (nodes.Element) -> None
- pass
+ self.body.append('\n')
def visit_seealso(self, node):
# type: (nodes.Element) -> None
diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py
index 17a2f7eb8..a0a3efb00 100644
--- a/tests/test_build_manpage.py
+++ b/tests/test_build_manpage.py
@@ -59,3 +59,10 @@ def test_default_man_pages():
expected = [('index', 'stasi', 'STASI™ Documentation 1.0',
["Wolfgang Schäuble & G'Beckstein"], 1)]
assert default_man_pages(config) == expected
+
+
+@pytest.mark.sphinx('man', testroot='markup-rubric')
+def test_rubric(app, status, warning):
+ app.build()
+ content = (app.outdir / 'python.1').text()
+ assert 'This is a rubric\n' in content