From a68e072bac980394509930e0e6338b42f9fe0df5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Jan 2016 12:14:12 -0800 Subject: 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. --- src/Text/Pandoc/Writers/MediaWiki.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 -- cgit v1.2.3