DokuWiki writer: More tweaks to email links. (#1398)
This commit is contained in:
parent
80467d1b18
commit
71da4f8c55
1 changed files with 3 additions and 4 deletions
|
@ -44,7 +44,7 @@ import Text.Pandoc.Options
|
||||||
import Text.Pandoc.Shared
|
import Text.Pandoc.Shared
|
||||||
import Text.Pandoc.Writers.Shared
|
import Text.Pandoc.Writers.Shared
|
||||||
import Text.Pandoc.Templates (renderTemplate')
|
import Text.Pandoc.Templates (renderTemplate')
|
||||||
import Data.List ( intersect, intercalate )
|
import Data.List ( intersect, intercalate, isPrefixOf )
|
||||||
import Network.URI ( isURI )
|
import Network.URI ( isURI )
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
|
|
||||||
|
@ -418,9 +418,8 @@ inlineToDokuWiki _ Space = return " "
|
||||||
inlineToDokuWiki opts (Link txt (src, _)) = do
|
inlineToDokuWiki opts (Link txt (src, _)) = do
|
||||||
label <- inlineListToDokuWiki opts txt
|
label <- inlineListToDokuWiki opts txt
|
||||||
case txt of
|
case txt of
|
||||||
[Str s] | escapeURI s == src -> return src
|
[Str s] | "mailto:" `isPrefixOf` src -> return $ "<" ++ s ++ ">"
|
||||||
| "mailto:" ++ escapeURI s == src -> return $
|
| escapeURI s == src -> return src
|
||||||
"<" ++ s ++ ">"
|
|
||||||
_ -> if isURI src
|
_ -> if isURI src
|
||||||
then return $ "[[" ++ src ++ "|" ++ label ++ "]]"
|
then return $ "[[" ++ src ++ "|" ++ label ++ "]]"
|
||||||
else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
|
else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
|
||||||
|
|
Loading…
Reference in a new issue