From dd2b77d5900014ef865ba8a23ac0ad4acdc946b1 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 10 Aug 2008 23:26:32 +0000 Subject: Allow newline before URL in markdown link references. Resolves Issue #81. Added tests for this issue in new "markdown-reader-more" tests. Changed RunTests.hs to run these tests. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1401 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Text/Pandoc/Readers') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index 89dbfe9a9..cf1053628 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -187,10 +187,9 @@ referenceKey = try $ do nonindentSpaces lab <- reference char ':' - skipSpaces - optional (char '<') - src <- many (noneOf "> \n\t") - optional (char '>') + skipSpaces >> optional newline >> skipSpaces >> notFollowedBy (char '[') + src <- (char '<' >> many (noneOf "> \n\t") >>~ char '>') + <|> many (noneOf " \n\t") tit <- option "" referenceTitle blanklines endPos <- getPosition @@ -203,8 +202,7 @@ referenceKey = try $ do referenceTitle :: GenParser Char st String referenceTitle = try $ do - (many1 spaceChar >> option '\n' newline) <|> newline - skipSpaces + skipSpaces >> optional newline >> skipSpaces tit <- (charsInBalanced '(' ')' >>= return . unwords . words) <|> do delim <- char '\'' <|> char '"' manyTill anyChar (try (char delim >> skipSpaces >> -- cgit v1.2.3