aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-09-10 09:49:06 +0200
committerJohn MacFarlane <[email protected]>2025-09-10 09:49:06 +0200
commit71a0c5c61ef303b3d7889a3a1e0d26f0b92c59d8 (patch)
treea9eab6ec9da3ffc91bc66ab47e2c0f89565ef19d /src
parent3a2aab568d9206ab48a5fb2e1d896c6457bb21e2 (diff)
Markdown writer: use approximate pipe tables when it's the only option.
If we have a table with row/colspans that can rendered as an approximate pipe table (without row/colspans), and no other table format is enabled that could render the table, we fall back to an "approximate" pipe table, with no row/colspans. Closes #11128.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 102ab83e3..d70496ddf 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -675,6 +675,14 @@ blockToMarkdown' opts t@(Table (ident,_,_) blkCapt specs thead tbody tfoot) = do
writeHtml5String opts{ writerTemplate = Nothing }
(Pandoc nullMeta [t])
return $ tbl $$ blankline -- caption is in the HTML table
+ | hasSimpleCells,
+ hasColRowSpans,
+ isEnabled Ext_pipe_tables opts -> do
+ -- In this case an approximate pipe table will be rendered,
+ -- without col/row spans. This is better than nothing, since
+ -- we have no other way to render the table correctly (#11128).
+ tbl <- mkTable (pipeTable opts)
+ return $ (tbl $$ caption''') $$ blankline
| otherwise
-> do
report (BlockNotRendered t)