git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: prefer pipe_tables to raw html...
7c2dd03John MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+3−3
@@ -628,15 +628,15 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
628 writerColumns opts >= 8 * numcols -> (id,) <$>
628 writerColumns opts >= 8 * numcols -> (id,) <$>
629 gridTable opts blockListToMarkdown
629 gridTable opts blockListToMarkdown
630 (all null headers) aligns' widths' headers rows
630 (all null headers) aligns' widths' headers rows
631− | isEnabled Ext_raw_html opts -> fmap (id,) $
632− (text . T.unpack) <$>
633− (writeHtml5String opts{ writerTemplate = Nothing } $ Pandoc nullMeta [t])
634 | hasSimpleCells &&
631 | hasSimpleCells &&
635 isEnabled Ext_pipe_tables opts -> do
632 isEnabled Ext_pipe_tables opts -> do
636 rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
633 rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers
637 rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
634 rawRows <- mapM (fmap padRow . mapM (blockListToMarkdown opts))
638 rows
635 rows
639 (id,) <$> pipeTable (all null headers) aligns' rawHeaders rawRows
636 (id,) <$> pipeTable (all null headers) aligns' rawHeaders rawRows
637+ | isEnabled Ext_raw_html opts -> fmap (id,) $
638+ (text . T.unpack) <$>
639+ (writeHtml5String opts{ writerTemplate = Nothing } $ Pandoc nullMeta [t])
640 | otherwise -> return $ (id, text "[TABLE]")
640 | otherwise -> return $ (id, text "[TABLE]")
641 return $ nst (tbl $$ caption'') $$ blankline
641 return $ nst (tbl $$ caption'') $$ blankline
642blockToMarkdown' opts (BulletList items) = do
642blockToMarkdown' opts (BulletList items) = do
test/command/3734.md+3−21
@@ -4,27 +4,9 @@
4|--------------|-------|--------------------------------------------------------------------------|
4|--------------|-------|--------------------------------------------------------------------------|
5| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
5| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
6^D
6^D
7−<table>
8−<colgroup>
9−<col style="width: 14%" />
10−<col style="width: 7%" />
11−<col style="width: 77%" />
12−</colgroup>
13−<thead>
14−<tr class="header">
15−<th>aaaaaaaaaaaa</th>
16−<th>bbbbb</th>
17−<th>ccccccccccc</th>
7+| aaaaaaaaaaaa | bbbbb | ccccccccccc |
18−</tr>
8+|--------------|-------|--------------------------------------------------------------------------|
19−</thead>
20−<tbody>
21−<tr class="odd">
22−<td>aaaaaaaaaaaa</td>
23−<td></td>
24−<td>cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc</td>
9+| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
25−</tr>
26−</tbody>
27−</table>
28```
10```
29
11
30```
12```