aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-02-15 20:27:29 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-02-15 20:27:29 -0800
commit5491adbfdb0a1c75d2008ad40da7136dffeeb161 (patch)
tree3fc7e7c3d361f19d1261e3dee0a673fff03cca8d
parent11f74074454d8c58da18ee1b7e2480530baeb7e1 (diff)
downloadpandoc-5491adbfdb0a1c75d2008ad40da7136dffeeb161.tar.gz
Markdown reader: litChar now includes entities.
We no longer need to use fromEntities on titles.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 1ba6d2bdd..74485fb9d 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -45,7 +45,6 @@ import Text.Pandoc.Parsing hiding (tableWith)
import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
import Text.Pandoc.Readers.HTML ( htmlTag, htmlInBalanced, isInlineTag, isBlockTag,
isTextTag, isCommentTag )
-import Text.Pandoc.XML ( fromEntities )
import Text.Pandoc.Biblio (processBiblio)
import qualified Text.CSL as CSL
import Data.Monoid (mconcat, mempty)
@@ -144,6 +143,7 @@ atMostSpaces n = (char ' ' >> atMostSpaces (n-1)) <|> return ()
litChar :: MarkdownParser Char
litChar = escapedChar'
+ <|> characterReference
<|> noneOf "\n"
<|> try (newline >> notFollowedBy blankline >> return ' ')
@@ -287,7 +287,7 @@ referenceTitle :: MarkdownParser String
referenceTitle = try $ do
skipSpaces >> optional newline >> skipSpaces
let parenTit = charsInBalanced '(' ')' litChar
- fromEntities <$> (quotedTitle '"' <|> quotedTitle '\'' <|> parenTit)
+ quotedTitle '"' <|> quotedTitle '\'' <|> parenTit
-- A link title in quotes
quotedTitle :: Char -> MarkdownParser String
@@ -295,7 +295,7 @@ quotedTitle c = try $ do
char c
notFollowedBy spaces
let pEnder = try $ char c >> notFollowedBy (satisfy isAlphaNum)
- let regChunk = many1 (noneOf ['\\','\n',c]) <|> count 1 litChar
+ let regChunk = many1 (noneOf ['\\','\n','&',c]) <|> count 1 litChar
let nestedChunk = (\x -> [c] ++ x ++ [c]) <$> quotedTitle c
unwords . words . concat <$> manyTill (nestedChunk <|> regChunk) pEnder
@@ -1500,7 +1500,7 @@ source = do
return (escapeURI $ trimr src, tit)
linkTitle :: MarkdownParser String
-linkTitle = fromEntities <$> (quotedTitle '"' <|> quotedTitle '\'')
+linkTitle = quotedTitle '"' <|> quotedTitle '\''
link :: MarkdownParser (F Inlines)
link = try $ do