aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-17 06:53:48 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-17 06:53:48 +0000
commit97bff3f9dcb5cccd1800380ac215fb1f4a02b281 (patch)
treec4c23c29213e7cd5c41566909b1298f1e4f28bf9 /src/Text/Pandoc
parent16e5b15cae3c96c185c6be64a5f7256e402067df (diff)
downloadpandoc-97bff3f9dcb5cccd1800380ac215fb1f4a02b281.tar.gz
MediaWiki writer: Support images in figures.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1898 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/MediaWiki.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs
index 07fddcfb4..f81fda5d4 100644
--- a/src/Text/Pandoc/Writers/MediaWiki.hs
+++ b/src/Text/Pandoc/Writers/MediaWiki.hs
@@ -80,6 +80,14 @@ blockToMediaWiki _ Null = return ""
blockToMediaWiki opts (Plain inlines) =
inlineListToMediaWiki opts inlines
+blockToMediaWiki opts (Para [Image txt (src,tit)]) = do
+ capt <- inlineListToMediaWiki opts txt
+ let opt = if null txt
+ then ""
+ else "|alt=" ++ if null tit then capt else tit ++
+ "|caption " ++ capt
+ return $ "[[Image:" ++ src ++ "|frame|none" ++ opt ++ "]]\n"
+
blockToMediaWiki opts (Para inlines) = do
useTags <- get >>= return . stUseTags
listLevel <- get >>= return . stListLevel