@@ -45,7 +45,6 @@ import Text.Pandoc.Parsing hiding (tableWith)
4545import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
4646import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
4747 isTextTag, isCommentTag )
48−import Text.Pandoc.XML ( fromEntities )
4948import Text.Pandoc.Biblio (processBiblio)
5049import qualified Text.CSL as CSL
5150import Data.Monoid (mconcat, mempty)
@@ -144,6 +143,7 @@ atMostSpaces n = (char ' ' >> atMostSpaces (n-1)) <|> return ()
144143
145144litChar :: MarkdownParser Char
146145litChar = escapedChar'
146+ <|> characterReference
147147 <|> noneOf "\n"
148148 <|> try (newline >> notFollowedBy blankline >> return ' ')
149149
@@ -287,7 +287,7 @@ referenceTitle :: MarkdownParser String
287287referenceTitle = try $ do
288288 skipSpaces >> optional newline >> skipSpaces
289289 let parenTit = charsInBalanced '(' ')' litChar
290− fromEntities <$> (quotedTitle '"' <|> quotedTitle '\'' <|> parenTit)
290+ quotedTitle '"' <|> quotedTitle '\'' <|> parenTit
291291
292292-- A link title in quotes
293293quotedTitle :: Char -> MarkdownParser String
@@ -295,7 +295,7 @@ quotedTitle c = try $ do
295295 char c
296296 notFollowedBy spaces
297297 let pEnder = try $ char c >> notFollowedBy (satisfy isAlphaNum)
298− let regChunk = many1 (noneOf ['\\','\n',c]) <|> count 1 litChar
298+ let regChunk = many1 (noneOf ['\\','\n','&',c]) <|> count 1 litChar
299299 let nestedChunk = (\x -> [c] ++ x ++ [c]) <$> quotedTitle c
300300 unwords . words . concat <$> manyTill (nestedChunk <|> regChunk) pEnder
301301
@@ -1500,7 +1500,7 @@ source = do
15001500 return (escapeURI $ trimr src, tit)
15011501
15021502linkTitle :: MarkdownParser String
1503−linkTitle = fromEntities <$> (quotedTitle '"' <|> quotedTitle '\'')
1503+linkTitle = quotedTitle '"' <|> quotedTitle '\''
15041504
15051505link :: MarkdownParser (F Inlines)
15061506link = try $ do