aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-13 10:43:43 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-13 10:43:43 -0700
commit8f65590ce9fc84452b22a3914190a8d9bc4ceda2 (patch)
tree32830240754311eb8700ce58f0720f718294c7ef /src/Text/Pandoc
parent506866ef7368ed1cae9236bfd8323fde64eeb154 (diff)
downloadpandoc-8f65590ce9fc84452b22a3914190a8d9bc4ceda2.tar.gz
CommonMark writer: prefer pipe tables to HTML tables...
...even if it means losing relative column width information. See #3734.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs5
1 files changed, 2 insertions, 3 deletions
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