From fbb048238ef25616b9f288535101a360630f624e Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 18 Sep 2007 01:34:36 +0000 Subject: Markdown reader: require space before title in links and references. This fixes a bug in parsing URLs like http://silly/url(withparen). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1025 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/Markdown.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index aa2d9d14d..ce8a4b8eb 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -56,7 +56,6 @@ readMarkdown state str = (readWith parseMarkdown) state (str ++ "\n\n") spaceChars = " \t" bulletListMarkers = "*+-" hruleChars = "*-_" -titleOpeners = "\"'(" setextHChars = "=-" -- treat these as potentially non-text when parsing inline: @@ -185,8 +184,7 @@ referenceKey = try $ do return $ replicate (sourceLine endPos - sourceLine startPos) '\n' referenceTitle = try $ do - skipSpaces - optional newline + (many1 spaceChar >> option '\n' newline) <|> newline skipSpaces tit <- (charsInBalanced '(' ')' >>= return . unwords . words) <|> do delim <- char '\'' <|> char '"' @@ -831,8 +829,7 @@ source = try $ do return (removeTrailingSpace src, tit) linkTitle = try $ do - skipSpaces - optional newline + (many1 spaceChar >> option '\n' newline) <|> newline skipSpaces delim <- char '\'' <|> char '"' tit <- manyTill anyChar (try (char delim >> skipSpaces >> -- cgit v1.2.3