|
From: <gr...@us...> - 2013-03-08 09:03:25
|
Revision: 7626
http://docutils.svn.sourceforge.net/docutils/?rev=7626&view=rev
Author: grubert
Date: 2013-03-08 09:03:16 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
Fix [3607063] handle lines starting with a period.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/functional/expected/standalone_rst_manpage.man
trunk/docutils/test/test_writers/test_manpage.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2013-03-08 08:37:32 UTC (rev 7625)
+++ trunk/docutils/HISTORY.txt 2013-03-08 09:03:16 UTC (rev 7626)
@@ -64,6 +64,7 @@
* docutils/writers/manpage.py
+ - Fix [3607063] handle lines starting with a period.
- Fix option separating comma was bold (thanks to Bill Morris).
Release 0.10 (2012-12-16)
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2013-03-08 08:37:32 UTC (rev 7625)
+++ trunk/docutils/docutils/writers/manpage.py 2013-03-08 09:03:16 UTC (rev 7626)
@@ -289,10 +289,10 @@
text = text.replace(in_char, out_markup)
# unicode
text = self.deunicode(text)
+ # prevent interpretation of "." at line start
+ if text[0] == '.':
+ text = '\\&' + text
if self._in_literal:
- # prevent interpretation of "." at line start
- if text[0] == '.':
- text = '\\&' + text
text = text.replace('\n.', '\n\\&.')
self.body.append(text)
Modified: trunk/docutils/test/functional/expected/standalone_rst_manpage.man
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2013-03-08 08:37:32 UTC (rev 7625)
+++ trunk/docutils/test/functional/expected/standalone_rst_manpage.man 2013-03-08 09:03:16 UTC (rev 7626)
@@ -93,7 +93,7 @@
.IP 3. 3
number lists
.IP 4. 3
-math: The LaTeX source is shown, e.g. \fBn! + \esin(x_n^2)\fP.
+math: The LaTeX source is shown, e.g. \fBn! + \esin(x_n^2)\fP\&.
.UNINDENT
.sp
Discussion is still open.
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2013-03-08 08:37:32 UTC (rev 7625)
+++ trunk/docutils/test/test_writers/test_manpage.py 2013-03-08 09:03:16 UTC (rev 7626)
@@ -138,6 +138,7 @@
something important
+. period at line start.
""",
r""".\" Man page generated from reStructuredText.
.
@@ -194,6 +195,8 @@
something important
.UNINDENT
.UNINDENT
+.sp
+\&. period at line start.
.SH AUTHOR
so...@so...
@@ -292,7 +295,7 @@
.UNINDENT
.INDENT 0.0
.TP
-.B .
+.B \&.
bla bla bla
.UNINDENT
.INDENT 0.0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|