Dokuwiki writer: fix LineBreaks in Tables (#4444)

fixes #4313
This commit is contained in:
Mauro Bieg 2018-03-12 02:20:36 +01:00 committed by John MacFarlane
parent 2f979e0684
commit a0da1e2723
3 changed files with 15 additions and 5 deletions

View file

@ -479,7 +479,11 @@ inlineToDokuWiki _ il@(RawInline f str)
| f == Format "html" = return $ "<html>" ++ str ++ "</html>" | f == Format "html" = return $ "<html>" ++ str ++ "</html>"
| otherwise = "" <$ report (InlineNotRendered il) | otherwise = "" <$ report (InlineNotRendered il)
inlineToDokuWiki _ LineBreak = return "\\\\\n" inlineToDokuWiki _ LineBreak = do
backSlash <- stBackSlashLB <$> ask
return $ if backSlash
then "\n"
else "\\\\\n"
inlineToDokuWiki opts SoftBreak = inlineToDokuWiki opts SoftBreak =
case writerWrapText opts of case writerWrapText opts of

View file

@ -1,4 +1,5 @@
Sample grid table. Sample grid table.
^Fruit ^Price^Advantages ^ ^Fruit ^Price^Advantages ^
|Bananas|$1.34|built-in wrapper\\ \\ potassium| |Bananas|$1.34|built-in wrapper\\ \\ potassium |
|Oranges|$2.10|* cures scurvy\\ * tasty | |Oranges|$2.10|* cures scurvy\\ * tasty |
|Apples |$1.10|Some text\\ \\ after two linebreaks|

View file

@ -10,4 +10,9 @@
,[Para [Str "$2.10"]] ,[Para [Str "$2.10"]]
,[BulletList ,[BulletList
[[Plain [Str "cures",Space,Str "scurvy"]] [[Plain [Str "cures",Space,Str "scurvy"]]
,[Plain [Str "tasty"]]]]]]] ,[Plain [Str "tasty"]]]]]
,[[Para [Str "Apples"]]
,[Para [Str "$1.10"]]
,[Para [Str "Some",Space,Str "text",LineBreak,LineBreak,Str "after",Space,Str "two",Space,Str "linebreaks"]
]]
]]