diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-07-24 11:36:49 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-07-24 11:38:24 -0700 |
commit | 50e8c3b107c56d5de4840f369a2e49e4f55cd591 (patch) | |
tree | a133cc47c770dced36b2d6d52163c34a5d071b9b | |
parent | 4e899eb9c886df2200551f69a3f593ab5258f2e2 (diff) | |
download | pandoc-50e8c3b107c56d5de4840f369a2e49e4f55cd591.tar.gz |
MediaWiki writer: Avoid extra blank line in tables with empty cells.
Note that the old output is semantically identical, but the
new output looks better.
Closes #4794.
-rw-r--r-- | src/Text/Pandoc/Writers/MediaWiki.hs | 1 | ||||
-rw-r--r-- | test/command/4794.md | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index df50028a0..666853a3c 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -313,6 +313,7 @@ tableCellToMediaWiki headless rownum (alignment, width, bs) = do let sep = case bs of [Plain _] -> " " [Para _] -> " " + [] -> "" _ -> "\n" return $ marker ++ attr ++ sep ++ trimr contents diff --git a/test/command/4794.md b/test/command/4794.md new file mode 100644 index 000000000..8356d2157 --- /dev/null +++ b/test/command/4794.md @@ -0,0 +1,18 @@ +``` +% pandoc -f markdown -t mediawiki +| Column1 | Column2 | Column3 | +| ------- | ------- | ------- | +| text | | text | +^D +{| +! Column1 +! Column2 +! Column3 +|- +| text +| +| text +|} + + +``` |