diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-14 10:56:41 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-14 10:59:27 -0700 |
commit | 8bf39cf6d676ec9ebb8ac0e13b60621ea363d6f3 (patch) | |
tree | 65dcdc1cf51026d60234d932e88b3f144ec8e92a /src | |
parent | 5524b5286bd51386b149bfc0846a94aa77dc64db (diff) | |
download | pandoc-8bf39cf6d676ec9ebb8ac0e13b60621ea363d6f3.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 6 |
1 files changed, 4 insertions, 2 deletions
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 '>') |