diff options
author | Clare Macrae <clare.macrae@googlemail.com> | 2013-07-15 19:29:39 +0100 |
---|---|---|
committer | Clare Macrae <clare.macrae@googlemail.com> | 2013-07-15 19:29:39 +0100 |
commit | 18565e149a2de3f6bb83563890cc9e4f65679693 (patch) | |
tree | 3d82197fd132bf6d6f23da63e84ce9e370f4bf12 /src | |
parent | b2a8731e32c27a230a970b747df13ad84d473b5d (diff) | |
download | pandoc-18565e149a2de3f6bb83563890cc9e4f65679693.tar.gz |
Implement conversion of images in dokuwiki writer (#386)
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 9 |
1 files changed, 5 insertions, 4 deletions
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 |