HTML reader: fix column width regression.

Column widths specified with a style attribute were
off by a factor of 100 in 2.14.

Closes #7334.
This commit is contained in:
John MacFarlane 2021-05-30 17:15:14 -07:00
parent cc206af392
commit fc70f44ee2

View file

@ -49,7 +49,7 @@ pCol = try $ do
return $ case lookup "width" attribs of return $ case lookup "width" attribs of
Nothing -> case lookup "style" attribs of Nothing -> case lookup "style" attribs of
Just (T.stripPrefix "width:" -> Just xs) | T.any (== '%') xs -> Just (T.stripPrefix "width:" -> Just xs) | T.any (== '%') xs ->
maybe (Right ColWidthDefault) (Right . ColWidth) maybe (Right ColWidthDefault) (Right . ColWidth . (/ 100.0))
$ safeRead (T.filter $ safeRead (T.filter
(`notElem` (" \t\r\n%'\";" :: [Char])) xs) (`notElem` (" \t\r\n%'\";" :: [Char])) xs)
_ -> Right ColWidthDefault _ -> Right ColWidthDefault