diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 5354574b9..3aa0a6f12 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -928,9 +928,7 @@ referenceLinkSingle = try (do else fail "no corresponding key" return (Link label (Ref label))) -autoLink = do - notFollowedBy' (anyHtmlTag <|> anyHtmlEndTag) - autoLinkEmail <|> autoLinkRegular +autoLink = autoLinkEmail <|> autoLinkRegular -- a link <like@this.com> autoLinkEmail = try $ do @@ -941,10 +939,12 @@ autoLinkEmail = try $ do char autoLinkEnd return $ Link [Str src] (Src ("mailto:" ++ src) "") --- a link <like.this.com> +-- a link <http://like.this.com> autoLinkRegular = try $ do - src <- between (char autoLinkStart) (char autoLinkEnd) - (many (noneOf (spaceChars ++ endLineChars ++ [autoLinkEnd]))) + char autoLinkStart + prot <- oneOfStrings ["http:", "ftp:", "mailto:"] + rest <- many1Till (noneOf " \t\n<>") (char autoLinkEnd) + let src = prot ++ rest return $ Link [Str src] (Src src "") image = try (do |