diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-02 12:14:12 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-02 12:14:12 -0800 |
commit | a68e072bac980394509930e0e6338b42f9fe0df5 (patch) | |
tree | ec5c08a18a047a0e3c7f15b81c42090da6deb802 /src/Text | |
parent | 6ed41cbdcc68184dfcc275da91c0fabada2e1796 (diff) | |
download | pandoc-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')
-rw-r--r-- | src/Text/Pandoc/Writers/MediaWiki.hs | 6 |
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 |