@@ -623,15 +623,21 @@ blockListToMarkdown opts blocks =
623 -- code block will be treated as a list continuation paragraph
623 -- code block will be treated as a list continuation paragraph
624 where fixBlocks (b : CodeBlock attr x : rest)
624 where fixBlocks (b : CodeBlock attr x : rest)
625 | (not (isEnabled Ext_fenced_code_blocks opts) || attr == nullAttr)
625 | (not (isEnabled Ext_fenced_code_blocks opts) || attr == nullAttr)
626− && isListBlock b =
626+ && isListBlock b = b : commentSep : CodeBlock attr x :
627− b : RawBlock "html" "<!-- -->\n" : CodeBlock attr x :
628− fixBlocks rest
627+ fixBlocks rest
628+ fixBlocks (b1@(BulletList _) : b2@(BulletList _) : bs) =
629+ b1 : commentSep : fixBlocks (b2:bs)
630+ fixBlocks (b1@(OrderedList _ _) : b2@(OrderedList _ _) : bs) =
631+ b1 : commentSep : fixBlocks (b2:bs)
632+ fixBlocks (b1@(DefinitionList _) : b2@(DefinitionList _) : bs) =
633+ b1 : commentSep : fixBlocks (b2:bs)
629 fixBlocks (x : xs) = x : fixBlocks xs
634 fixBlocks (x : xs) = x : fixBlocks xs
630 fixBlocks [] = []
635 fixBlocks [] = []
631 isListBlock (BulletList _) = True
636 isListBlock (BulletList _) = True
632 isListBlock (OrderedList _ _) = True
637 isListBlock (OrderedList _ _) = True
633 isListBlock (DefinitionList _) = True
638 isListBlock (DefinitionList _) = True
634 isListBlock _ = False
639 isListBlock _ = False
640+ commentSep = RawBlock "html" "<!-- -->\n"
636-- | Get reference for target; if none exists, create unique one and return.
642-- | Get reference for target; if none exists, create unique one and return.
637-- Prefer label if possible; otherwise, generate a unique key.
643-- Prefer label if possible; otherwise, generate a unique key.