File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -470,16 +470,18 @@ blockToMarkdown' opts b@(RawBlock f str) = do
470470 let renderEmpty = mempty <$ report (BlockNotRendered b)
471471 case variant of
472472 PlainText
473- | f == " plain" -> return $ literal str <> literal " \n "
473+ | f == " plain" -> return $ nest 0 ( literal str) <> literal " \n "
474474 Commonmark
475475 | f `elem` [" gfm" , " commonmark" , " commonmark_x" , " markdown" ]
476- -> return $ literal str $$ blankline
476+ -> return $ nest 0 ( literal str) $$ blankline
477477 | f `elem` [" html" , " html5" , " html4" ]
478478 -> return $ literal (removeBlankLinesInHTML str) $$ blankline
479479 Markdown
480480 | f `elem` [" markdown" , " markdown_github" , " markdown_phpextra" ,
481481 " markdown_mmd" , " markdown_strict" ]
482- -> return $ literal str <> literal " \n "
482+ -- the 'nest 0' ensures that leading and trailing newlines
483+ -- don't get collapsed. See #10477 for context;
484+ -> return $ nest 0 (literal str) <> literal " \n "
483485 Markua -> renderEmpty
484486 _ | f `elem` [" html" , " html5" , " html4" ]
485487 , isEnabled Ext_markdown_attribute opts
You can’t perform that action at this time.
0 commit comments