git.iko.soy/typeable/pandoc
on master help sign in
Modified escaping in Man writer. Also changed
e6f67fcfiddlosopher
src/Text/Pandoc/Writers/Man.hs+5−5
@@ -69,8 +69,8 @@ metaToMan options (Meta title authors date) = do
69 "\" \"") <> title' <> text ("\" \"User Manuals\"")
69 "\" \"") <> title' <> text ("\" \"User Manuals\"")
70 let foot = case length authors of
70 let foot = case length authors of
71 0 -> text $ ""
71 0 -> text $ ""
72− 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep "\n" authors
72+ 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors
73− 2 -> text $ ".SH AUTHORS\n" ++ joinWithSep "\n" authors
73+ 2 -> text $ ".SH AUTHORS\n" ++ joinWithSep ", " authors
74 return $ if writerStandalone options
74 return $ if writerStandalone options
75 then (head, foot)
75 then (head, foot)
76 else (empty, empty)
76 else (empty, empty)
@@ -105,11 +105,11 @@ escapeNbsp str =
105
105
106-- | Escape special characters for Man.
106-- | Escape special characters for Man.
107escapeString :: String -> String
107escapeString :: String -> String
108−escapeString = escapeNbsp . backslashEscape "-\\"
108+escapeString = escapeNbsp . backslashEscape "\"-'.\\"
109
109
110-- | Escape a literal (code) section for Man.
110-- | Escape a literal (code) section for Man.
111escapeCode :: String -> String
111escapeCode :: String -> String
112−escapeCode = backslashEscape "-\\\t "
112+escapeCode = backslashEscape "\t " . escapeString
113
113
114-- | Convert Pandoc block element to man.
114-- | Convert Pandoc block element to man.
115blockToMan :: WriterOptions -- ^ Options
115blockToMan :: WriterOptions -- ^ Options
@@ -259,5 +259,5 @@ inlineToMan opts (Note contents) = do
259 modify (\notes -> contents:notes) -- add to notes in state
259 modify (\notes -> contents:notes) -- add to notes in state
260 notes <- get
260 notes <- get
261 let ref = show $ (length notes)
261 let ref = show $ (length notes)
262− return $ text "[^" <> text ref <> char ']'
262+ return $ text "[" <> text ref <> char ']'
263
263