@@ -149,6 +149,7 @@ where
149149import Text.Pandoc.Definition
150150import Text.Pandoc.Options
151151import Text.Pandoc.Builder (Blocks, Inlines, rawBlock)
152+import Text.Pandoc.XML (fromEntities)
152153import qualified Text.Pandoc.UTF8 as UTF8 (putStrLn)
153154import Text.Parsec
154155import Text.Parsec.Pos (newPos)
@@ -369,7 +370,7 @@ romanNumeral upperCase = do
369370-- escaped mailto: URI.
370371emailAddress :: Parser [Char] st (String, String)
371372emailAddress = try $ liftA2 toResult mailbox (char '@' *> domain)
372− where toResult mbox dom = let full = mbox ++ '@':dom
373+ where toResult mbox dom = let full = fromEntities $ mbox ++ '@':dom
373374 in (full, escapeURI $ "mailto:" ++ full)
374375 mailbox = intercalate "." `fmap` (emailWord `sepby1` dot)
375376 domain = intercalate "." `fmap` (subdomain `sepby1` dot)
@@ -440,7 +441,7 @@ uri = try $ do
440441 <|> enclosed (char '[') (char ']') uriChunk)
441442 <|> uriChunk))
442443 str' <- option str $ char '/' >> return (str ++ "/")
443− let uri' = scheme ++ ":" ++ str'
444+ let uri' = scheme ++ ":" ++ fromEntities str'
444445 return (uri', escapeURI uri')
445446
446447-- | Applies a parser, returns tuple of its results and its horizontal