From bb5ac55f67d204e2ea42c044639ee3114045b50b Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 22 Jul 2007 20:13:43 +0000 Subject: Man writer: Use ~ and ^ for subscripts and superscripts. git-svn-id: https://pandoc.googlecode.com/svn/trunk@770 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/Man.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index a0d8447f0..ce8dc574f 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -80,9 +80,9 @@ metaToMan options (Meta title authors date) = do let head = (text ".TH") <+> title' <+> section <+> doubleQuotes (text date) <+> hsep extras let foot = case length authors of - 0 -> text $ "" - 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors - 2 -> text $ ".SH AUTHORS\n" ++ joinWithSep ", " authors + 0 -> empty + 1 -> text ".SH AUTHOR" $$ (text $ joinWithSep ", " authors) + 2 -> text ".SH AUTHORS" $$ (text $ joinWithSep ", " authors) return $ if writerStandalone options then (head, foot) else (empty, empty) @@ -261,9 +261,12 @@ inlineToMan opts (Strong lst) = do inlineToMan opts (Strikeout lst) = do contents <- inlineListToMan opts lst return $ text "[STRIKEOUT:" <> contents <> char ']' --- just treat superscripts and subscripts like normal text -inlineToMan opts (Superscript lst) = inlineListToMan opts lst -inlineToMan opts (Subscript lst) = inlineListToMan opts lst +inlineToMan opts (Superscript lst) = do + contents <- inlineListToMan opts lst + return $ char '^' <> contents <> char '^' +inlineToMan opts (Subscript lst) = do + contents <- inlineListToMan opts lst + return $ char '~' <> contents <> char '~' inlineToMan opts (Quoted SingleQuote lst) = do contents <- inlineListToMan opts lst return $ char '`' <> contents <> char '\'' -- cgit v1.2.3