git.iko.soy/typeable/pandoc
on master help sign in
Dokuwiki writer: fix LineBreaks in Tables (#4444)

fixes #4313

commita0da1e2723a08b4afc12a6e358d3abfdffeb6944 authorMauro Bieg <mb21@users.noreply.github.com> dateMon 12 Mar 2018, 02:20 (9 years ago) parent2f979e0
3 files changed+15−5
src/Text/Pandoc/Writers/DokuWiki.hs+5−1 test/dokuwiki_multiblock_table.dokuwiki+4−3 test/dokuwiki_multiblock_table.native+6−1
src/Text/Pandoc/Writers/DokuWiki.hs+5−1
@@ -479,7 +479,11 @@ inlineToDokuWiki _ il@(RawInline f str)
479479 | f == Format "html" = return $ "<html>" ++ str ++ "</html>"
480480 | otherwise = "" <$ report (InlineNotRendered il)
481481
482−inlineToDokuWiki _ LineBreak = return "\\\\\n"
482+inlineToDokuWiki _ LineBreak = do
483+ backSlash <- stBackSlashLB <$> ask
484+ return $ if backSlash
485+ then "\n"
486+ else "\\\\\n"
483487
484488inlineToDokuWiki opts SoftBreak =
485489 case writerWrapText opts of
test/dokuwiki_multiblock_table.dokuwiki+4−3
@@ -1,4 +1,5 @@
11Sample grid table.
2−^Fruit ^Price^Advantages ^
3−|Bananas|$1.34|built-in wrapper\\ \\ potassium|
4−|Oranges|$2.10|* cures scurvy\\ * tasty |
2+^Fruit ^Price^Advantages ^
3+|Bananas|$1.34|built-in wrapper\\ \\ potassium |
4+|Oranges|$2.10|* cures scurvy\\ * tasty |
5+|Apples |$1.10|Some text\\ \\ after two linebreaks|
test/dokuwiki_multiblock_table.native+6−1
@@ -10,4 +10,9 @@
1010 ,[Para [Str "$2.10"]]
1111 ,[BulletList
1212 [[Plain [Str "cures",Space,Str "scurvy"]]
13− ,[Plain [Str "tasty"]]]]]]]
13+ ,[Plain [Str "tasty"]]]]]
14+ ,[[Para [Str "Apples"]]
15+ ,[Para [Str "$1.10"]]
16+ ,[Para [Str "Some",Space,Str "text",LineBreak,LineBreak,Str "after",Space,Str "two",Space,Str "linebreaks"]
17+ ]]
18+ ]]