aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-03 13:20:57 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-04 22:11:56 -0800
commit22b2c02aeb5260aa9f904601d051c47a1dfb68d6 (patch)
treece856ca90e911ea1848a745eae9827a86d059287
parentdac2e9156fffe4cef12271e0284e5f43f5b7e10f (diff)
downloadpandoc-22b2c02aeb5260aa9f904601d051c47a1dfb68d6.tar.gz
Markdown reader: Removed unneeded definitions.
specialChars, strChar, specialCharsMinusLt.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 2c8bef063..4ab3f9275 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -66,10 +66,6 @@ hruleChars = "*-_"
setextHChars :: [Char]
setextHChars = "=-"
--- treat these as potentially non-text when parsing inline:
-specialChars :: [Char]
-specialChars = "\\[]*_~`<>$!^-.&@'\";\8216\8217\8220\8221"
-
--
-- auxiliary functions
--
@@ -296,6 +292,7 @@ block = do
, bulletList
, orderedList
, definitionList
+ , rawTeXBlock
, para
, rawHtmlBlocks
, plain
@@ -698,6 +695,13 @@ rawVerbatimBlock = try $ do
contents <- manyTill anyChar (htmlTag (~== TagClose tag))
return $ open ++ contents ++ renderTags [TagClose tag]
+rawTeXBlock :: GenParser Char ParserState Block
+rawTeXBlock = do
+ failIfStrict
+ result <- rawLaTeXEnvironment' <|> rawConTeXtEnvironment'
+ spaces
+ return $ Para [TeX result]
+
rawHtmlBlocks :: GenParser Char ParserState Block
rawHtmlBlocks = do
htmlBlocks <- many1 $ do blk <- rawVerbatimBlock <|>
@@ -933,9 +937,6 @@ ltSign = do
else notFollowedBy' rawHtmlBlocks >> char '<' -- unless it starts html
return $ Str ['<']
-specialCharsMinusLt :: [Char]
-specialCharsMinusLt = filter (/= '<') specialChars
-
exampleRef :: GenParser Char ParserState Inline
exampleRef = try $ do
char '@'
@@ -1028,9 +1029,6 @@ whitespace = spaceChar >>
nonEndline :: GenParser Char st Char
nonEndline = satisfy (/='\n')
-strChar :: GenParser Char st Char
-strChar = noneOf (specialChars ++ " \t\n")
-
str :: GenParser Char ParserState Inline
str = do
a <- alphaNum