diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index a00ab1cc6..a46520fbd 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -185,6 +185,9 @@ blockToRST opts (OrderedList items) = do contents <- mapM (\(item, num) -> orderedListItemToRST opts item num) $ zip [1..] items return $ (vcat contents) <> text "\n" +blockToRST opts (DefinitionList items) = do + contents <- mapM (definitionListItemToRST opts) items + return $ (vcat contents) <> text "\n" -- | Convert bullet list item (list of blocks) to RST. bulletListItemToRST :: WriterOptions -> [Block] -> State WriterState Doc @@ -203,6 +206,13 @@ orderedListItemToRST opts num items = do return $ hang (text ((show num) ++ "." ++ spacer)) (writerTabStop opts) contents +-- | Convert defintion list item (label, list of blocks) to RST. +definitionListItemToRST :: WriterOptions -> ([Inline], [Block]) -> State WriterState Doc +definitionListItemToRST opts (label, items) = do + label <- inlineListToRST opts label + contents <- blockListToRST opts items + return $ label $+$ nest (writerTabStop opts) contents + -- | Convert list of Pandoc block elements to RST. blockListToRST :: WriterOptions -- ^ Options -> [Block] -- ^ List of block elements |