aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-04-17 10:04:39 -0700
committerGitHub <noreply@github.com>2020-04-17 10:04:39 -0700
commit906305de789c83f9fdcc2c7d30044acf97e89582 (patch)
treef359e991e60e7324f11e73a40259ed9dc3e4b91b /src/Text/Pandoc/Writers/Markdown.hs
parentf0f3cc14beeea51f703f7cfc8b40ebf3de2d0a05 (diff)
parentd1521af8fb0d3e8ee4104224e4d5e0b6e6bfad8c (diff)
downloadpandoc-906305de789c83f9fdcc2c7d30044acf97e89582.tar.gz
Merge pull request #6224 from despresc/better-tables
Diffstat (limited to 'src/Text/Pandoc/Writers/Markdown.hs')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 58299f5ea..7a11e3c16 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -574,14 +574,15 @@ blockToMarkdown' opts (BlockQuote blocks) = do
else if plain then " " else "> "
contents <- blockListToMarkdown opts blocks
return $ (prefixed leader contents) <> blankline
-blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
+blockToMarkdown' opts t@(Table _ blkCapt specs thead tbody tfoot) = do
+ let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
let numcols = maximum (length aligns : length widths :
map length (headers:rows))
caption' <- inlineListToMarkdown opts caption
let caption'' = if null caption || not (isEnabled Ext_table_captions opts)
then blankline
else blankline $$ (": " <> caption') $$ blankline
- let hasSimpleCells = onlySimpleTableCells $ headers:rows
+ let hasSimpleCells = onlySimpleTableCells $ headers : rows
let isSimple = hasSimpleCells && all (==0) widths
let isPlainBlock (Plain _) = True
isPlainBlock _ = False