aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 70a94fb2c..01fa4788d 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -456,15 +456,16 @@ definitionListItem = try $ do
return ((normalizeSpaces term), contents)
defRawBlock = try $ do
- indentSpaces
- first <- anyLine
- rest <- manyTill (do {option "" (try indentSpaces);
- anyLine}) blanklines
- return $ (unlines (first:rest)) ++ "\n"
+ rawlines <- many1 (do {notFollowedBy' blankline; indentSpaces; anyLine})
+ trailing <- option "" blanklines
+ return $ (unlines rawlines) ++ trailing
definitionList = do
items <- many1 definitionListItem
- return $ DefinitionList items
+ let (terms, defs) = unzip items
+ let defs' = compactify defs
+ let items' = zip terms defs'
+ return $ DefinitionList items'
--
-- paragraph block