git.iko.soy/typeable/pandoc
on master help sign in
Man writer: Use ~ and ^ for subscripts and superscripts.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@770 788f1e2b-df1e-0410-8736-df70ead52e1b

commitbb5ac55f67d204e2ea42c044639ee3114045b50b authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 22 Jul 2007, 20:13 (19 years ago) parent7006d9a
1 file changed+9−6
src/Text/Pandoc/Writers/Man.hs+9−6
src/Text/Pandoc/Writers/Man.hs+9−6
@@ -80,9 +80,9 @@ metaToMan options (Meta title authors date) = do
8080 let head = (text ".TH") <+> title' <+> section <+>
8181 doubleQuotes (text date) <+> hsep extras
8282 let foot = case length authors of
83− 0 -> text $ ""
84− 1 -> text $ ".SH AUTHOR\n" ++ joinWithSep ", " authors
85− 2 -> text $ ".SH AUTHORS\n" ++ joinWithSep ", " authors
83+ 0 -> empty
84+ 1 -> text ".SH AUTHOR" $$ (text $ joinWithSep ", " authors)
85+ 2 -> text ".SH AUTHORS" $$ (text $ joinWithSep ", " authors)
8686 return $ if writerStandalone options
8787 then (head, foot)
8888 else (empty, empty)
@@ -261,9 +261,12 @@ inlineToMan opts (Strong lst) = do
261261inlineToMan opts (Strikeout lst) = do
262262 contents <- inlineListToMan opts lst
263263 return $ text "[STRIKEOUT:" <> contents <> char ']'
264−-- just treat superscripts and subscripts like normal text
265−inlineToMan opts (Superscript lst) = inlineListToMan opts lst
266−inlineToMan opts (Subscript lst) = inlineListToMan opts lst
264+inlineToMan opts (Superscript lst) = do
265+ contents <- inlineListToMan opts lst
266+ return $ char '^' <> contents <> char '^'
267+inlineToMan opts (Subscript lst) = do
268+ contents <- inlineListToMan opts lst
269+ return $ char '~' <> contents <> char '~'
267270inlineToMan opts (Quoted SingleQuote lst) = do
268271 contents <- inlineListToMan opts lst
269272 return $ char '`' <> contents <> char '\''