aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-01-02 12:14:12 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-01-02 12:14:12 -0800
commita68e072bac980394509930e0e6338b42f9fe0df5 (patch)
treeec5c08a18a047a0e3c7f15b81c42090da6deb802 /src/Text/Pandoc/Writers
parent6ed41cbdcc68184dfcc275da91c0fabada2e1796 (diff)
downloadpandoc-a68e072bac980394509930e0e6338b42f9fe0df5.tar.gz
MediaWiki writer: fix spacing issues.
+ Start cell on new line unless it's a single Para or Plain. + For single Para or Plain, insert a space after the `|` to avoid problems when the text begins with a character like `-`. Closes #2604, closes #2606.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/MediaWiki.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs
index d14865612..0da8bc98c 100644
--- a/src/Text/Pandoc/Writers/MediaWiki.hs
+++ b/src/Text/Pandoc/Writers/MediaWiki.hs
@@ -306,7 +306,11 @@ tableCellToMediaWiki headless rownum (alignment, width, bs) = do
let attr = if null attrs
then ""
else unwords attrs ++ "|"
- return $ marker ++ attr ++ trimr contents
+ let sep = case bs of
+ [Plain _] -> " "
+ [Para _] -> " "
+ _ -> "\n"
+ return $ marker ++ attr ++ sep ++ trimr contents
alignmentToString :: Alignment -> String
alignmentToString alignment = case alignment of