|
From: <gr...@us...> - 2020-06-30 20:34:16
|
Revision: 8519
http://sourceforge.net/p/docutils/code/8519
Author: grubert
Date: 2020-06-30 20:34:14 +0000 (Tue, 30 Jun 2020)
Log Message:
-----------
Apply Patch 168 manpage crashing on empty citation
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2020-06-15 08:48:46 UTC (rev 8518)
+++ trunk/docutils/HISTORY.txt 2020-06-30 20:34:14 UTC (rev 8519)
@@ -70,8 +70,9 @@
* docutils/writers/manpage.py
- - [ Fix #126 ] manpage title with spaces.
- - [ Fix #380 ] commandline option problem in sphinx.
+ - Patch [ #168 ] fix crashing on empty citation (by Takeshi KOMIYA).
+ - Fix [ #126 ] manpage title with spaces.
+ - Fix [ #380 ] commandline option problem in sphinx.
.. _pip: https://pypi.org/project/pip/
.. _legacy_class_functions: docs/user/config.html#legacy-class-functions
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2020-06-15 08:48:46 UTC (rev 8518)
+++ trunk/docutils/docutils/writers/manpage.py 2020-06-30 20:34:14 UTC (rev 8519)
@@ -476,7 +476,7 @@
depart_caution = depart_admonition
def visit_citation(self, node):
- num, text = node.astext().split(None, 1)
+ num = node.astext().split(None, 1)[0]
num = num.strip()
self.body.append('.IP [%s] 5\n' % num)
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2020-06-15 08:48:46 UTC (rev 8518)
+++ trunk/docutils/test/test_writers/test_manpage.py 2020-06-30 20:34:14 UTC (rev 8519)
@@ -396,7 +396,25 @@
"""],
]
+totest['citation'] = [
+ [""".. [docutils] blah blah blah
+.. [empty_citation]
+""",
+ r""".\" Man page generated from reStructuredText.
+.
+.TH "" "" "" ""
+.SH NAME
+ \-
+"""+indend_macros+
+r""".IP [docutils] 5
+blah blah blah
+.IP [empty_citation] 5
+.\" Generated by docutils manpage writer.
+.
+"""],
+ ]
+
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|