diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-18 01:34:36 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-09-18 01:34:36 +0000 |
commit | fbb048238ef25616b9f288535101a360630f624e (patch) | |
tree | fa40119efafbbb54e9695408bd5f680ce5875981 /src | |
parent | 78ff2d2fee65ce9280d2172c05db32f49c3f7fa0 (diff) | |
download | pandoc-fbb048238ef25616b9f288535101a360630f624e.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 7 |
1 files changed, 2 insertions, 5 deletions
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 >> |