diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-10 23:26:32 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-10 23:26:32 +0000 |
commit | dd2b77d5900014ef865ba8a23ac0ad4acdc946b1 (patch) | |
tree | 093d810d3d4c9af3302c4eb416242f3390436279 /Text/Pandoc/Readers | |
parent | ac28fa29d348b801033fd813e33ebceff2699300 (diff) | |
download | pandoc-dd2b77d5900014ef865ba8a23ac0ad4acdc946b1.tar.gz |
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
Diffstat (limited to 'Text/Pandoc/Readers')
-rw-r--r-- | Text/Pandoc/Readers/Markdown.hs | 10 |
1 files changed, 4 insertions, 6 deletions
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 >> |