git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki writer: don't softbreak lines inside list items.

Closes #3531.

commit358dfba8f4eba45fdfdfad2c117de99df8b45bc4 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 26 Mar 2017, 20:41 (10 years ago) parent51ab1bf
2 files changed+23−1
src/Text/Pandoc/Writers/MediaWiki.hs+4−1 test/command/3531.md+19
src/Text/Pandoc/Writers/MediaWiki.hs+4−1
@@ -409,10 +409,13 @@ inlineToMediaWiki LineBreak = return "<br />\n"
409409
410410inlineToMediaWiki SoftBreak = do
411411 wrapText <- gets (writerWrapText . stOptions)
412+ listlevel <- asks listLevel
412413 case wrapText of
413414 WrapAuto -> return " "
414415 WrapNone -> return " "
415− WrapPreserve -> return "\n"
416+ WrapPreserve -> if null listlevel
417+ then return "\n"
418+ else return " "
416419
417420inlineToMediaWiki Space = return " "
418421
test/command/3531.mdnew file+19
@@ -0,0 +1,19 @@
1+```
2+% pandoc -t mediawiki --wrap=preserve
3+* This is a list item.
4+* This is a list item in Markdown. It is
5+ continued in the next line.
6+ * It has a sub-item.
7+* This is the next list item.
8+
9+A paragraph can span multiple lines
10+without being broken into pieces.
11+^D
12+* This is a list item.
13+* This is a list item in Markdown. It is continued in the next line.
14+** It has a sub-item.
15+* This is the next list item.
16+
17+A paragraph can span multiple lines
18+without being broken into pieces.
19+```