diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2014-12-08 23:55:36 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2014-12-08 23:55:36 +0000 |
commit | 48e2586ec80dd883d83cd57bffcad9c97c1e7599 (patch) | |
tree | 39d28212436b0f3dcd9cbec12ff504512f52ce31 /src/Text/Pandoc/Writers/DokuWiki.hs | |
parent | dd9cb2c872188a2eabe20b4afdf2865969bcff70 (diff) | |
parent | 98161afa1a907a904dd86d2906106e28344a21ce (diff) | |
download | pandoc-48e2586ec80dd883d83cd57bffcad9c97c1e7599.tar.gz |
Merge pull request #1746 from shelf/dw-ext-images
DokuWiki writer: fix external images
Diffstat (limited to 'src/Text/Pandoc/Writers/DokuWiki.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 74418aa7e..eed45a965 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -134,7 +134,9 @@ blockToDokuWiki opts (Para [Image txt (src,'f':'i':'g':':':tit)]) = do let opt = if null txt then "" else "|" ++ if null tit then capt else tit ++ capt - return $ "{{:" ++ src ++ opt ++ "}}\n" + -- Relative links fail isURI and receive a colon + prefix = if isURI src then "" else ":" + return $ "{{" ++ prefix ++ src ++ opt ++ "}}\n" blockToDokuWiki opts (Para inlines) = do indent <- stIndent <$> ask @@ -478,7 +480,9 @@ inlineToDokuWiki opts (Image alt (source, tit)) = do ("", []) -> "" ("", _ ) -> "|" ++ alt' (_ , _ ) -> "|" ++ tit - return $ "{{:" ++ source ++ txt ++ "}}" + -- Relative links fail isURI and receive a colon + prefix = if isURI source then "" else ":" + return $ "{{" ++ prefix ++ source ++ txt ++ "}}" inlineToDokuWiki opts (Note contents) = do contents' <- blockListToDokuWiki opts contents |