Permalink
Browse files

Markdown reader: Fixed backslash escapes in reference links.

Closes #312.
  • Loading branch information...
1 parent 7512c9d commit 9f9a57de19058154221f2a80bd9b307b22d7bde1 John MacFarlane committed Dec 6, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/Text/Pandoc/Readers/Markdown.hs
@@ -217,16 +217,15 @@ referenceKey = try $ do
lab <- reference
char ':'
skipSpaces >> optional newline >> skipSpaces >> notFollowedBy (char '[')
- let nl = char '\n' >> notFollowedBy blankline >> return ' '
let sourceURL = liftM unwords $ many $ try $ do
notFollowedBy' referenceTitle
skipMany spaceChar
- optional nl
+ optional $ newline >> notFollowedBy blankline
skipMany spaceChar
notFollowedBy' reference
- many1 (satisfy $ not . isBlank)
+ many1 $ escapedChar' <|> satisfy (not . isBlank)
let betweenAngles = try $ char '<' >>
- manyTill (noneOf ">\n" <|> nl) (char '>')
+ manyTill (escapedChar' <|> litChar) (char '>')
src <- try betweenAngles <|> sourceURL
tit <- option "" referenceTitle
blanklines

0 comments on commit 9f9a57d

Please sign in to comment.