aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Textile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Textile.hs')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
index 5aae11751..fef192fd3 100644
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -377,10 +377,13 @@ table = try $ do
_ -> (mempty, rawrows)
let nbOfCols = maximum $ map length (headers:rows)
let aligns = map minimum $ transpose $ map (map (snd . fst)) (headers:rows)
- return $ B.table caption
- (zip aligns (replicate nbOfCols 0.0))
- (map snd headers)
- (map (map snd) rows)
+ let toRow = Row nullAttr . map B.simpleCell
+ toHeaderRow l = if null l then [] else [toRow l]
+ return $ B.table (B.simpleCaption $ B.plain caption)
+ (zip aligns (replicate nbOfCols ColWidthDefault))
+ (TableHead nullAttr $ toHeaderRow $ map snd headers)
+ [TableBody nullAttr 0 [] $ map (toRow . map snd) rows]
+ (TableFoot nullAttr [])
-- | Ignore markers for cols, thead, tfoot.
ignorableRow :: PandocMonad m => ParserT Text ParserState m ()