@@ -787,6 +787,7 @@ blockListToMarkdown :: PandocMonad m
787787 -> MD m Doc
788788blockListToMarkdown opts blocks = do
789789 inlist <- asks envInList
790+ isPlain <- asks envPlain
790791 -- a) insert comment between list and indented code block, or the
791792 -- code block will be treated as a list continuation paragraph
792793 -- b) change Plain to Para unless it's followed by a RawBlock
@@ -813,9 +814,11 @@ blockListToMarkdown opts blocks = do
813814 isListBlock (OrderedList _ _) = True
814815 isListBlock (DefinitionList _) = True
815816 isListBlock _ = False
816− commentSep = if isEnabled Ext_raw_html opts
817− then RawBlock "html" "<!-- -->\n"
818− else RawBlock "markdown" " \n"
817+ commentSep = if isPlain
818+ then Null
819+ else if isEnabled Ext_raw_html opts
820+ then RawBlock "html" "<!-- -->\n"
821+ else RawBlock "markdown" " \n"
819822 mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . cat
820823
821824getKey :: Doc -> Key