From e6f67fcc57872bf0e4574a0163f91f1ac259cd9f Mon Sep 17 00:00:00 2001
From: fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
Date: Sun, 1 Jul 2007 23:23:36 +0000
Subject: [PATCH] Modified escaping in Man writer.  Also changed format of
 footnote references and authors list.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@608 788f1e2b-df1e-0410-8736-df70ead52e1b
---
 src/Text/Pandoc/Writers/Man.hs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index f8cfe755a..f6514919c 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -69,8 +69,8 @@ metaToMan options (Meta title authors date) = do
              "\" \"") <> title' <> text ("\" \"User Manuals\"")
   let foot = case length authors of
                 0 -> text $ ""
-                1 -> text $ ".SH AUTHOR\n" ++ joinWithSep "\n" authors
-                2 -> text $ ".SH AUTHORS\n" ++ joinWithSep "\n" authors
+                1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors
+                2 -> text $ ".SH AUTHORS\n" ++ joinWithSep ", " authors
   return $ if writerStandalone options
      then (head, foot)
      else (empty, empty)
@@ -105,11 +105,11 @@ escapeNbsp str =
 
 -- | Escape special characters for Man.
 escapeString :: String -> String
-escapeString = escapeNbsp . backslashEscape "-\\"
+escapeString = escapeNbsp . backslashEscape "\"-'.\\"
 
 -- | Escape a literal (code) section for Man.
 escapeCode :: String -> String
-escapeCode = backslashEscape "-\\\t "
+escapeCode = backslashEscape "\t " . escapeString
 
 -- | Convert Pandoc block element to man.
 blockToMan :: WriterOptions -- ^ Options
@@ -259,5 +259,5 @@ inlineToMan opts (Note contents) = do
   modify (\notes -> contents:notes) -- add to notes in state
   notes <- get
   let ref = show $ (length notes)
-  return $ text "[^" <> text ref <> char ']'
+  return $ text "[" <> text ref <> char ']'