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
This commit is contained in:
parent
78ff2d2fee
commit
fbb048238e
1 changed files with 2 additions and 5 deletions
|
@ -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 >>
|
||||
|
|
Loading…
Add table
Reference in a new issue