From 8bf39cf6d676ec9ebb8ac0e13b60621ea363d6f3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 14 Aug 2014 10:56:41 -0700 Subject: Markdown reader: Better handle quote characters in inline links. This was previously failing to be recognized as a link: [Test](http://en.wikipedia.org/wiki/Ward's_method) Closes #1534. --- src/Text/Pandoc/Readers/Markdown.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 26ea764be..6b7f1a8fb 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1635,8 +1635,10 @@ source :: MarkdownParser (String, String) source = do char '(' skipSpaces - let urlChunk = try $ notFollowedBy (oneOf "\"')") >> - (parenthesizedChars <|> count 1 litChar) + let urlChunk = + try parenthesizedChars + <|> (notFollowedBy (oneOf " )") >> (count 1 litChar)) + <|> try (many1 spaceChar <* notFollowedBy (oneOf "\"')")) let sourceURL = (unwords . words . concat) <$> many urlChunk let betweenAngles = try $ char '<' >> manyTill litChar (char '>') -- cgit v1.2.3