From fbecb49790311480ff5e830052bf17c732ff8eab Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 21 Dec 2007 22:31:20 +0000 Subject: Modified 'source' parser in Markdown reader to allow backslash escapes in URLs. So, for example, [my](/url\(1\)) yields a link to /url(1). Resolves Issue #34. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1151 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Text/Pandoc') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index 9b927ccd7..2c0bf8db8 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -818,9 +818,10 @@ reference = notFollowedBy' (string "[^") >> -- footnote reference -- source for a link, with optional title source = try $ do char '(' - optional (char '<') - src <- many (noneOf ")> \t\n") - optional (char '>') + src <- try (char '<' >> + many ((char '\\' >> anyChar) <|> noneOf "> \t\n") >>~ + char '>') + <|> many ((char '\\' >> anyChar) <|> noneOf ") \t\n") tit <- option "" linkTitle skipSpaces char ')' -- cgit v1.2.3