From cc410a71b58de1fa0e508a092b7c1d8ba6d3d3ab Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 15 Feb 2013 22:56:53 -0800 Subject: Allow `&` in emails (for entities). Added tests for entities in titles and links. Closes #723. --- src/Text/Pandoc/Parsing.hs | 2 +- src/Text/Pandoc/Readers/Markdown.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 062e66eff..0bb609e5d 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -380,7 +380,7 @@ emailAddress = try $ liftA2 toResult mailbox (char '@' *> domain) notFollowedBy space) emailWord = many1 $ satisfy isEmailChar isEmailChar c = isAlphaNum c || isEmailPunct c - isEmailPunct c = c `elem` "!\"#$%&'*+-/=?^_{|}~" + isEmailPunct c = c `elem` "!\"#$%&'*+-/=?^_{|}~;" -- note: sepBy1 from parsec consumes input when sep -- succeeds and p fails, so we use this variant here. sepby1 p sep = liftA2 (:) p (many (try $ sep >> p)) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 74485fb9d..e037c0897 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -264,7 +264,7 @@ referenceKey = try $ do optional $ newline >> notFollowedBy blankline skipMany spaceChar notFollowedBy' (() <$ reference) - many1 $ escapedChar' <|> satisfy (not . isBlank) + many1 $ notFollowedBy space >> litChar let betweenAngles = try $ char '<' >> manyTill (escapedChar' <|> litChar) (char '>') src <- try betweenAngles <|> sourceURL -- cgit v1.2.3