aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-02-15 22:56:53 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-02-15 23:02:17 -0800
commitcc410a71b58de1fa0e508a092b7c1d8ba6d3d3ab (patch)
tree8787b90c78b7367e46a61833a4bd721e255ab73c /src
parent59764fa3884e63ee9711cc2d0da2ef3133c641ba (diff)
downloadpandoc-cc410a71b58de1fa0e508a092b7c1d8ba6d3d3ab.tar.gz
Allow `&` in emails (for entities).
Added tests for entities in titles and links. Closes #723.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Parsing.hs2
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
2 files changed, 2 insertions, 2 deletions
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