diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 024c56685..f981dd9ad 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -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' |