aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 27e730f9f..6f4e5672e 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1159,6 +1159,7 @@ table = try $ do
inline :: Parser [Char] ParserState (F Inlines)
inline = choice [ whitespace
+ , bareURL
, str
, endline
, code
@@ -1471,6 +1472,14 @@ referenceLink constructor (lab, raw) = do
Nothing -> (\x -> B.str "[" <> x <> B.str "]" <> B.str raw') <$> fallback
Just (src,tit) -> constructor src tit <$> lab
+bareURL :: Parser [Char] ParserState (F Inlines)
+bareURL = try $ do
+ guardEnabled Ext_autolink_urls
+ (orig, src) <- uri <|> emailAddress
+ (guardEnabled Ext_monospace_autolinks >>
+ return (return $ B.link src "" (B.codeWith ("",["url"],[]) orig)))
+ <|> return (return $ B.link src "" (B.str orig))
+
autoLink :: Parser [Char] ParserState (F Inlines)
autoLink = try $ do
char '<'