@@ -553,8 +553,13 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
553553 else blankline $$ (": " <> caption') $$ blankline
554554 let isLineBreak LineBreak = Any True
555555 isLineBreak _ = Any False
556− let isSimple = all (==0) widths &&
557− not ( getAny (query isLineBreak (headers:rows)) )
556+ let hasLineBreak = getAny . query isLineBreak
557+ let isSimpleCell [Plain ils] = not (hasLineBreak ils)
558+ isSimpleCell [Para ils ] = not (hasLineBreak ils)
559+ isSimpleCell [] = True
560+ isSimpleCell _ = False
561+ let hasSimpleCells = all isSimpleCell (concat (headers:rows))
562+ let isSimple = hasSimpleCells && all (==0) widths
558563 let isPlainBlock (Plain _) = True
559564 isPlainBlock _ = False
560565 let hasBlocks = not (all isPlainBlock $ concat . concat $ headers:rows)
@@ -589,6 +594,9 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
589594 | isEnabled Ext_raw_html opts -> fmap (id,) $
590595 (text . T.unpack) <$>
591596 (writeHtml5String def $ Pandoc nullMeta [t])
597+ | hasSimpleCells &&
598+ isEnabled Ext_pipe_tables opts -> fmap (id,) $
599+ pipeTable (all null headers) aligns' rawHeaders rawRows
592600 | otherwise -> return $ (id, text "[TABLE]")
593601 return $ nst $ tbl $$ caption'' $$ blankline
594602blockToMarkdown' opts (BulletList items) = do