aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-22 20:13:43 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-22 20:13:43 +0000
commitbb5ac55f67d204e2ea42c044639ee3114045b50b (patch)
treeb4c8810ea0466bb90e00b86546ab2f7be2678be2 /src/Text/Pandoc/Writers
parent7006d9a044c01222a0a656e3b4b374e388f3dd78 (diff)
downloadpandoc-bb5ac55f67d204e2ea42c044639ee3114045b50b.tar.gz
Man writer: Use ~ and ^ for subscripts and superscripts.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@770 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Man.hs15
1 files changed, 9 insertions, 6 deletions
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 '\''