MediaWiki writer: don't softbreak lines inside list items.

Closes #3531.
This commit is contained in:
John MacFarlane 2017-03-26 20:41:09 +02:00
parent 51ab1bf270
commit 358dfba8f4
2 changed files with 23 additions and 1 deletions

View file

@ -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 " "

19
test/command/3531.md Normal file
View file

@ -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.
```