aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-07-24 11:36:49 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-07-24 11:38:24 -0700
commit50e8c3b107c56d5de4840f369a2e49e4f55cd591 (patch)
treea133cc47c770dced36b2d6d52163c34a5d071b9b
parent4e899eb9c886df2200551f69a3f593ab5258f2e2 (diff)
downloadpandoc-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.hs1
-rw-r--r--test/command/4794.md18
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
+|}
+
+
+```