Man writer: Escape - as \-.

Unescaped -'s become hyphens, while \-'s are left as ascii
minus signs.  That is preferable for use with command-line
options.

See  http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html.
Thanks to Andrea Bolognani for bringing the issue to our
attention.
This commit is contained in:
John MacFarlane 2012-08-18 10:27:07 -07:00
parent 454b8ebb96
commit 5d3b295568
2 changed files with 11 additions and 11 deletions

View file

@ -105,7 +105,7 @@ manEscapes = [ ('\160', "\\ ")
, ('\x2014', "\\[em]")
, ('\x2013', "\\[en]")
, ('\x2026', "\\&...")
] ++ backslashEscapes "@\\"
] ++ backslashEscapes "-@\\"
-- | Escape special characters for Man.
escapeString :: String -> String

View file

@ -26,7 +26,7 @@ Here's a regular paragraph.
In Markdown 1.0.0 and earlier.
Version 8.
This line turns into a list item.
Because a hard-wrapped line in the middle of a paragraph looked like a list
Because a hard\-wrapped line in the middle of a paragraph looked like a list
item.
.PP
Here's one with a bullet.
@ -41,7 +41,7 @@ here.
* * * * *
.SH Block Quotes
.PP
E-mail style:
E\-mail style:
.RS
.PP
This is a block quote.
@ -87,7 +87,7 @@ Code:
.IP
.nf
\f[C]
----\ (should\ be\ four\ hyphens)
\-\-\-\-\ (should\ be\ four\ hyphens)
sub\ status\ {
\ \ \ \ print\ "working";
@ -489,7 +489,7 @@ Code block:
.IP
.nf
\f[C]
<!--\ Comment\ -->
<!\-\-\ Comment\ \-\->
\f[]
.fi
.PP
@ -568,11 +568,11 @@ Ellipses\&...and\&...and\&....
.IP \[bu] 2
223
.IP \[bu] 2
\f[I]p\f[]-Tree
\f[I]p\f[]\-Tree
.IP \[bu] 2
Here's some display math:
.RS
$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$
$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)\-f(x)}{h}$
.RE
.IP \[bu] 2
Here's one that has a line break in it:
@ -637,7 +637,7 @@ Left paren: (
.PP
Right paren: )
.PP
Greater-than: >
Greater\-than: >
.PP
Hash: #
.PP
@ -647,7 +647,7 @@ Bang: !
.PP
Plus: +
.PP
Minus: -
Minus: \-
.PP
* * * * *
.SH Links
@ -718,13 +718,13 @@ In a list?
.IP \[bu] 2
It should.
.PP
An e-mail address: <nobody@nowhere.net>
An e\-mail address: <nobody@nowhere.net>
.RS
.PP
Blockquoted: <http://example.com/>
.RE
.PP
Auto-links should not occur here: \f[C]<http://example.com/>\f[]
Auto\-links should not occur here: \f[C]<http://example.com/>\f[]
.IP
.nf
\f[C]