git.iko.soy/typeable/pandoc
on master help sign in
Commonmark writer: fix handling of SoftBreak with `hard_line_breaks`.

This should be rendered as a space. Closes #5195.

commitea8af33dab2ba5abba12c61ada7e62f9752cb973 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 2 Jan 2019, 10:31 (8 years ago) parent1bbbd5f
2 files changed+8−1
src/Text/Pandoc/Writers/CommonMark.hs+1−1 test/command/5195.md+7
src/Text/Pandoc/Writers/CommonMark.hs+1−1
@@ -247,7 +247,7 @@ inlineToNodes opts (Str s) = stringToNodes opts s'
247247inlineToNodes _ Space = (node (TEXT (T.pack " ")) [] :)
248248inlineToNodes _ LineBreak = (node LINEBREAK [] :)
249249inlineToNodes opts SoftBreak
250− | isEnabled Ext_hard_line_breaks opts = (node LINEBREAK [] :)
250+ | isEnabled Ext_hard_line_breaks opts = (node (TEXT " ") [] :)
251251 | writerWrapText opts == WrapNone = (node (TEXT " ") [] :)
252252 | otherwise = (node SOFTBREAK [] :)
253253inlineToNodes opts (Emph xs) = (node EMPH (inlinesToNodes opts xs) :)
test/command/5195.mdnew file+7
@@ -0,0 +1,7 @@
1+```
2+% pandoc -f markdown_strict -t gfm+hard_line_breaks
3+Hello
4+there
5+^D
6+Hello there
7+```