aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Man.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Man.hs')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index e175135da..12001b534 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -109,8 +109,10 @@ parseTable = do
let widths = if isPlainTable
then repeat ColWidthDefault
else repeat $ ColWidth (1.0 / fromIntegral (length alignments))
- return $ B.table mempty (zip alignments widths)
- headerRow bodyRows) <|> fallback pos
+ return $ B.table B.emptyCaption (zip alignments widths)
+ (TableHead nullAttr $ toHeaderRow headerRow)
+ [TableBody nullAttr 0 [] $ map toRow bodyRows]
+ (TableFoot nullAttr [])) <|> fallback pos
[] -> fallback pos
where
@@ -159,6 +161,9 @@ parseTable = do
'r' -> Just AlignRight
_ -> Nothing
+ toRow = Row nullAttr . map simpleCell
+ toHeaderRow l = if null l then [] else [toRow l]
+
parseNewParagraph :: PandocMonad m => ManParser m Blocks
parseNewParagraph = do
mmacro "P" <|> mmacro "PP" <|> mmacro "LP" <|> memptyLine