diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-08-18 10:27:07 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-08-18 10:29:15 -0700 |
commit | 5d3b2955681d84458537e3bea7b004262960d374 (patch) | |
tree | 9df1e9b8585dc8730d25d07277b8dea0b3a94a8e | |
parent | 454b8ebb966710edd9bcc2c61733515491026baf (diff) | |
download | pandoc-5d3b2955681d84458537e3bea7b004262960d374.tar.gz |
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.
-rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 2 | ||||
-rw-r--r-- | tests/writer.man | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index b3a4656a3..bececde25 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -105,7 +105,7 @@ manEscapes = [ ('\160', "\\ ") , ('\x2014', "\\[em]") , ('\x2013', "\\[en]") , ('\x2026', "\\&...") - ] ++ backslashEscapes "@\\" + ] ++ backslashEscapes "-@\\" -- | Escape special characters for Man. escapeString :: String -> String diff --git a/tests/writer.man b/tests/writer.man index 28bc0feb5..f0a6f348a 100644 --- a/tests/writer.man +++ b/tests/writer.man @@ -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] |