git.iko.soy/typeable/pandoc
on master help sign in
Plain writer: don't use   to separate list and indented code.
9fdc089John MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+6−3
@@ -787,6 +787,7 @@ blockListToMarkdown :: PandocMonad m
787 -> MD m Doc
787 -> MD m Doc
788blockListToMarkdown opts blocks = do
788blockListToMarkdown opts blocks = do
789 inlist <- asks envInList
789 inlist <- asks envInList
790+ isPlain <- asks envPlain
790 -- a) insert comment between list and indented code block, or the
791 -- a) insert comment between list and indented code block, or the
791 -- code block will be treated as a list continuation paragraph
792 -- code block will be treated as a list continuation paragraph
792 -- b) change Plain to Para unless it's followed by a RawBlock
793 -- b) change Plain to Para unless it's followed by a RawBlock
@@ -813,9 +814,11 @@ blockListToMarkdown opts blocks = do
813 isListBlock (OrderedList _ _) = True
814 isListBlock (OrderedList _ _) = True
814 isListBlock (DefinitionList _) = True
815 isListBlock (DefinitionList _) = True
815 isListBlock _ = False
816 isListBlock _ = False
817+ commentSep = if isPlain
818+ then Null
816− commentSep = if isEnabled Ext_raw_html opts
819+ else if isEnabled Ext_raw_html opts
817− then RawBlock "html" "<!-- -->\n"
820+ then RawBlock "html" "<!-- -->\n"
818− else RawBlock "markdown" "&nbsp;\n"
821+ else RawBlock "markdown" "&nbsp;\n"
819 mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . cat
822 mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . cat
820
823
821getKey :: Doc -> Key
824getKey :: Doc -> Key