aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
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 '>')