aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:45:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:45:45 -0700
commit71da4f8c55a042498cdc2d8f3f3a02c5dd823c47 (patch)
tree56398b420e4f9d2058c805c18038494959810c7b /src/Text/Pandoc/Writers
parent80467d1b184a045a30db78f84084b7af76a5f89b (diff)
downloadpandoc-71da4f8c55a042498cdc2d8f3f3a02c5dd823c47.tar.gz
DokuWiki writer: More tweaks to email links. (#1398)
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs
index 05db00361..929715bd9 100644
--- a/src/Text/Pandoc/Writers/DokuWiki.hs
+++ b/src/Text/Pandoc/Writers/DokuWiki.hs
@@ -44,7 +44,7 @@ import Text.Pandoc.Options
import Text.Pandoc.Shared
import Text.Pandoc.Writers.Shared
import Text.Pandoc.Templates (renderTemplate')
-import Data.List ( intersect, intercalate )
+import Data.List ( intersect, intercalate, isPrefixOf )
import Network.URI ( isURI )
import Control.Monad.State
@@ -418,9 +418,8 @@ inlineToDokuWiki _ Space = return " "
inlineToDokuWiki opts (Link txt (src, _)) = do
label <- inlineListToDokuWiki opts txt
case txt of
- [Str s] | escapeURI s == src -> return src
- | "mailto:" ++ escapeURI s == src -> return $
- "<" ++ s ++ ">"
+ [Str s] | "mailto:" `isPrefixOf` src -> return $ "<" ++ s ++ ">"
+ | escapeURI s == src -> return src
_ -> if isURI src
then return $ "[[" ++ src ++ "|" ++ label ++ "]]"
else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"