aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-09-04 21:56:06 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-09-04 21:56:06 -0700
commit9fdc089cd85e46148720f368644e8badd168f5b8 (patch)
treef3d9f5d5394768961209ebddaec447cb8c362375
parentd02518bf1b8e831136626f5909b8e45fcbfb2ad1 (diff)
downloadpandoc-9fdc089cd85e46148720f368644e8badd168f5b8.tar.gz
Plain writer: don't use &nbsp; to separate list and indented code.
There's no need for it in this context, since this isn't to be interpreted using Markdown rules.
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 523dfeaed..9d6064af6 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -787,6 +787,7 @@ blockListToMarkdown :: PandocMonad m
-> MD m Doc
blockListToMarkdown opts blocks = do
inlist <- asks envInList
+ isPlain <- asks envPlain
-- a) insert comment between list and indented code block, or the
-- code block will be treated as a list continuation paragraph
-- b) change Plain to Para unless it's followed by a RawBlock
@@ -813,9 +814,11 @@ blockListToMarkdown opts blocks = do
isListBlock (OrderedList _ _) = True
isListBlock (DefinitionList _) = True
isListBlock _ = False
- commentSep = if isEnabled Ext_raw_html opts
- then RawBlock "html" "<!-- -->\n"
- else RawBlock "markdown" "&nbsp;\n"
+ commentSep = if isPlain
+ then Null
+ else if isEnabled Ext_raw_html opts
+ then RawBlock "html" "<!-- -->\n"
+ else RawBlock "markdown" "&nbsp;\n"
mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . cat
getKey :: Doc -> Key