From 8f65590ce9fc84452b22a3914190a8d9bc4ceda2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 13 Aug 2017 10:43:43 -0700 Subject: CommonMark writer: prefer pipe tables to HTML tables... ...even if it means losing relative column width information. See #3734. --- src/Text/Pandoc/Writers/CommonMark.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs index 77562ed8a..446578f42 100644 --- a/src/Text/Pandoc/Writers/CommonMark.hs +++ b/src/Text/Pandoc/Writers/CommonMark.hs @@ -148,7 +148,7 @@ blockToNodes opts (DefinitionList items) ns = Plain (term ++ [LineBreak] ++ xs) : ys ++ concat zs dlToBullet (term, xs) = Para term : concat xs -blockToNodes opts t@(Table capt aligns widths headers rows) ns = do +blockToNodes opts t@(Table capt aligns _widths headers rows) ns = do let allcells = concat (headers:rows) let isLineBreak LineBreak = Any True isLineBreak _ = Any False @@ -156,8 +156,7 @@ blockToNodes opts t@(Table capt aligns widths headers rows) ns = do isPlainOrPara [Plain _] = True isPlainOrPara [] = True isPlainOrPara _ = False - let isSimple = all (==0) widths && - all isPlainOrPara allcells && + let isSimple = all isPlainOrPara allcells && not ( getAny (query isLineBreak allcells) ) if isEnabled Ext_pipe_tables opts && isSimple then do -- cgit v1.2.3