summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-30 09:59:22 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-30 09:59:22 -0700
commitb07ea7a02d94de042003a2287e5f5216a41e4e4e (patch)
tree7b9e230b11cb41ad98891457ca457e0258913375 /src
parente5740a138e291995d97e91d038d174977b0456f0 (diff)
RST reader: Consolidated rawBlock into directive.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index d6aa5aba1..e3ab7032b 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -132,7 +132,6 @@ parseBlocks = mconcat <$> manyTill block eof
block :: RSTParser Blocks
block = choice [ codeBlock
- , rawBlock
, blockQuote
, fieldList
, directive
@@ -354,18 +353,6 @@ birdTrackLine :: Parser [Char] st [Char]
birdTrackLine = char '>' >> manyTill anyChar newline
--
--- raw html/latex/etc
---
-
-rawBlock :: Parser [Char] st Blocks
-rawBlock = try $ do
- string ".. raw:: "
- lang <- many1 (letter <|> digit)
- blanklines
- result <- indentedBlock
- return $ B.rawBlock lang result
-
---
-- block quotes
--
@@ -501,10 +488,8 @@ directive = try $ do
directive'
-- TODO: line-block, parsed-literal, table, csv-table, list-table
--- replace, unicode
-- date
-- include
--- raw (consolidate)
-- class
-- title
directive' :: RSTParser Blocks
@@ -523,6 +508,7 @@ directive' = do
optional blanklines
let body' = body ++ "\n\n"
case label of
+ "raw" -> return $ B.rawBlock (trim top) (stripTrailingNewlines body)
"container" -> parseFromString parseBlocks body'
"replace" -> B.para <$> -- consumed by substKey
parseFromString (trimInlines . mconcat <$> many inline)