From 18565e149a2de3f6bb83563890cc9e4f65679693 Mon Sep 17 00:00:00 2001 From: Clare Macrae Date: Mon, 15 Jul 2013 19:29:39 +0100 Subject: Implement conversion of images in dokuwiki writer (#386) --- src/Text/Pandoc/Writers/DokuWiki.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index b6929ad1e..0651a8177 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -87,14 +87,15 @@ blockToDokuWiki opts (Plain inlines) = inlineListToDokuWiki opts inlines -- title beginning with fig: indicates that the image is a figure +-- dokuwiki doesn't support captions - so combine together alt and caption into alt blockToDokuWiki opts (Para [Image txt (src,'f':'i':'g':':':tit)]) = do capt <- if null txt then return "" - else ("|caption " ++) `fmap` inlineListToDokuWiki opts txt + else (" " ++) `fmap` inlineListToDokuWiki opts txt let opt = if null txt then "" - else "|alt=" ++ if null tit then capt else tit ++ capt - return $ "[[Image:" ++ src ++ "|frame|none" ++ opt ++ "]]\n" + else "|" ++ if null tit then capt else tit ++ capt + return $ "{{:" ++ src ++ opt ++ "}}\n" blockToDokuWiki opts (Para inlines) = do useTags <- get >>= return . stUseTags @@ -398,7 +399,7 @@ inlineToDokuWiki opts (Image alt (source, tit)) = do then "" else "|" ++ alt' else "|" ++ tit - return $ "[[Image:" ++ source ++ txt ++ "]]" + return $ "{{:" ++ source ++ txt ++ "}}" inlineToDokuWiki opts (Note contents) = do contents' <- blockListToDokuWiki opts contents -- cgit v1.2.3