From 4e34d366df31937cdc69b6b366355f10a84c16b2 Mon Sep 17 00:00:00 2001 From: despresc Date: Sat, 4 Apr 2020 16:35:42 -0400 Subject: Adapt to the newest Table type, fix some previous adaptation issues - Writers.Native is now adapted to the new Table type. - Inline captions should now be conditionally wrapped in a Plain, not a Para block. - The toLegacyTable function now lives in Writers.Shared. --- src/Text/Pandoc/Readers/HTML.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc/Readers/HTML.hs') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 8de9ebc19..30b812913 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -513,12 +513,12 @@ pTable = try $ do _ -> replicate cols AlignDefault let widths = if null widths' then if isSimple - then replicate cols Nothing - else replicate cols (Just (1.0 / fromIntegral cols)) + then replicate cols ColWidthDefault + else replicate cols (ColWidth (1.0 / fromIntegral cols)) else widths' return $ B.table caption (zip aligns widths) head' rows -pCol :: PandocMonad m => TagParser m (Maybe Double) +pCol :: PandocMonad m => TagParser m ColWidth pCol = try $ do TagOpen _ attribs' <- pSatisfy (matchTagOpen "col" []) let attribs = toStringAttr attribs' @@ -535,10 +535,10 @@ pCol = try $ do fromMaybe 0.0 $ safeRead xs _ -> 0.0 if width > 0.0 - then return $ Just $ width / 100.0 - else return Nothing + then return $ ColWidth $ width / 100.0 + else return ColWidthDefault -pColgroup :: PandocMonad m => TagParser m [Maybe Double] +pColgroup :: PandocMonad m => TagParser m [ColWidth] pColgroup = try $ do pSatisfy (matchTagOpen "colgroup" []) skipMany pBlank -- cgit v1.2.3