diff options
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 9 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 4 |
2 files changed, 7 insertions, 6 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 diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index 2a006f817..b3f3b3dd2 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -624,9 +624,9 @@ Auto-links should not occur here: <code><http://example.com/></code> From “Voyage dans la Lune” by Georges Melies (1902): -[[Image:lalune.jpg|frame|none|alt=Voyage dans la Lune|caption lalune]] +{{:lalune.jpg|Voyage dans la Lune lalune}} -Here is a movie [[Image:movie.jpg|movie]] icon. +Here is a movie {{:movie.jpg|movie}} icon. ---- |