diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-26 20:41:09 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-26 20:41:09 +0200 |
commit | 358dfba8f4eba45fdfdfad2c117de99df8b45bc4 (patch) | |
tree | 2fb933fd39485bbd410f912932bbce4146b8454a | |
parent | 51ab1bf2700f23e881aa06c638da4d3606fa22a4 (diff) |
MediaWiki writer: don't softbreak lines inside list items.
Closes #3531.
-rw-r--r-- | src/Text/Pandoc/Writers/MediaWiki.hs | 5 | ||||
-rw-r--r-- | test/command/3531.md | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 594e31e95..def245e38 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -409,10 +409,13 @@ inlineToMediaWiki LineBreak = return "<br />\n" inlineToMediaWiki SoftBreak = do wrapText <- gets (writerWrapText . stOptions) + listlevel <- asks listLevel case wrapText of WrapAuto -> return " " WrapNone -> return " " - WrapPreserve -> return "\n" + WrapPreserve -> if null listlevel + then return "\n" + else return " " inlineToMediaWiki Space = return " " diff --git a/test/command/3531.md b/test/command/3531.md new file mode 100644 index 000000000..d71cbadbd --- /dev/null +++ b/test/command/3531.md @@ -0,0 +1,19 @@ +``` +% pandoc -t mediawiki --wrap=preserve +* This is a list item. +* This is a list item in Markdown. It is + continued in the next line. + * It has a sub-item. +* This is the next list item. + +A paragraph can span multiple lines +without being broken into pieces. +^D +* This is a list item. +* This is a list item in Markdown. It is continued in the next line. +** It has a sub-item. +* This is the next list item. + +A paragraph can span multiple lines +without being broken into pieces. +``` |