@@ -575,8 +575,6 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
575575 let padRow r = case numcols - length r of
576576 x | x > 0 -> r ++ replicate x empty
577577 | otherwise -> r
578− rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
579− rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts)) rows
580578 let aligns' = case numcols - length aligns of
581579 x | x > 0 -> aligns ++ replicate x AlignDefault
582580 | otherwise -> aligns
@@ -586,16 +584,25 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
586584 (nst,tbl) <-
587585 case True of
588586 _ | isSimple &&
589− isEnabled Ext_simple_tables opts -> fmap (nest 2,) $
590− pandocTable opts False (all null headers) aligns' widths'
591− rawHeaders rawRows
587+ isEnabled Ext_simple_tables opts -> do
588+ rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
589+ rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
590+ rows
591+ (nest 2,) <$> pandocTable opts False (all null headers)
592+ aligns' widths' rawHeaders rawRows
592593 | isSimple &&
593− isEnabled Ext_pipe_tables opts -> fmap (id,) $
594− pipeTable (all null headers) aligns' rawHeaders rawRows
594+ isEnabled Ext_pipe_tables opts -> do
595+ rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
596+ rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
597+ rows
598+ (id,) <$> pipeTable (all null headers) aligns' rawHeaders rawRows
595599 | not hasBlocks &&
596− isEnabled Ext_multiline_tables opts -> fmap (nest 2,) $
597− pandocTable opts True (all null headers) aligns' widths'
598− rawHeaders rawRows
600+ isEnabled Ext_multiline_tables opts -> do
601+ rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
602+ rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
603+ rows
604+ (nest 2,) <$> pandocTable opts True (all null headers)
605+ aligns' widths' rawHeaders rawRows
599606 | isEnabled Ext_grid_tables opts &&
600607 writerColumns opts >= 8 * numcols -> (id,) <$>
601608 gridTable opts blockListToMarkdown
@@ -604,8 +611,11 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
604611 (text . T.unpack) <$>
605612 (writeHtml5String def $ Pandoc nullMeta [t])
606613 | hasSimpleCells &&
607− isEnabled Ext_pipe_tables opts -> fmap (id,) $
608− pipeTable (all null headers) aligns' rawHeaders rawRows
614+ isEnabled Ext_pipe_tables opts -> do
615+ rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
616+ rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
617+ rows
618+ (id,) <$> pipeTable (all null headers) aligns' rawHeaders rawRows
609619 | otherwise -> return $ (id, text "[TABLE]")
610620 return $ nst $ tbl $$ caption'' $$ blankline
611621blockToMarkdown' opts (BulletList items) = do