@@ -163,6 +163,9 @@ blockToMarkdown opts (OrderedList items) = do
163 contents <- mapM (\(item, num) -> orderedListItemToMarkdown opts item num) $
163 contents <- mapM (\(item, num) -> orderedListItemToMarkdown opts item num) $
164 zip [1..] items
164 zip [1..] items
165 return $ (vcat contents) <> text "\n"
165 return $ (vcat contents) <> text "\n"
166+blockToMarkdown opts (DefinitionList items) = do
167+ contents <- mapM (definitionListItemToMarkdown opts) items
168+ return $ (vcat contents) <> text "\n"
167-- | Convert bullet list item (list of blocks) to markdown.
170-- | Convert bullet list item (list of blocks) to markdown.
168bulletListItemToMarkdown :: WriterOptions -> [Block] -> State WriterState Doc
171bulletListItemToMarkdown :: WriterOptions -> [Block] -> State WriterState Doc
@@ -181,6 +184,17 @@ orderedListItemToMarkdown opts num items = do
181 return $ hang (text ((show num) ++ "." ++ spacer)) (writerTabStop opts)
184 return $ hang (text ((show num) ++ "." ++ spacer)) (writerTabStop opts)
182 contents
185 contents
187+-- | Convert definition list item (label, list of blocks) to markdown.
188+definitionListItemToMarkdown :: WriterOptions
189+ -> ([Inline],[Block])
190+ -> State WriterState Doc
191+definitionListItemToMarkdown opts (label, items) = do
192+ labelText <- inlineListToMarkdown opts label
193+ contents <- mapM (\item -> blockToMarkdown opts item >>=
194+ (return . hang (text ": ") (writerTabStop opts)))
195+ items >>= (return . vcat)
196+ return $ labelText $+$ contents
184-- | Convert list of Pandoc block elements to markdown.
198-- | Convert list of Pandoc block elements to markdown.
185blockListToMarkdown :: WriterOptions -- ^ Options
199blockListToMarkdown :: WriterOptions -- ^ Options
186 -> [Block] -- ^ List of block elements
200 -> [Block] -- ^ List of block elements