mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 09:47:06 +00:00
RST reader: Support .. line-block directive.
This is deprecated but may still be in older documents.
This commit is contained in:
@@ -53,9 +53,8 @@ import Control.Monad.Except (throwError)
|
||||
import Text.Pandoc.Class (PandocMonad, report, readFileFromDirs)
|
||||
|
||||
-- TODO:
|
||||
-- [ ] .. line-block
|
||||
-- [ ] .. parsed-literal
|
||||
-- [ ] .. table
|
||||
-- [ ] :widths: attribute in .. table
|
||||
-- [ ] .. csv-table
|
||||
-- [ ] .. list-table
|
||||
|
||||
@@ -241,6 +240,11 @@ lineBlock = try $ do
|
||||
lines'' <- mapM parseInlineFromString lines'
|
||||
return $ B.lineBlock lines''
|
||||
|
||||
lineBlockDirective :: PandocMonad m => String -> RSTParser m Blocks
|
||||
lineBlockDirective body = do
|
||||
lines' <- mapM parseInlineFromString $ lines $ stripTrailingNewlines body
|
||||
return $ B.lineBlock lines'
|
||||
|
||||
--
|
||||
-- paragraph block
|
||||
--
|
||||
@@ -627,6 +631,7 @@ directive' = do
|
||||
Nothing -> []
|
||||
case label of
|
||||
"table" -> tableDirective top fields body'
|
||||
"line-block" -> lineBlockDirective body'
|
||||
"raw" -> return $ B.rawBlock (trim top) (stripTrailingNewlines body)
|
||||
"role" -> addNewRole top $ map (\(k,v) -> (k, trim v)) fields
|
||||
"container" -> parseFromString parseBlocks body'
|
||||
|
||||
Reference in New Issue
Block a user