Markdown reader: renormalize table column widths if they exceed 100%.
Closes #2626.
This commit is contained in:
parent
a5efd2af11
commit
c4fdf28815
1 changed files with 6 additions and 1 deletions
|
@ -1452,11 +1452,16 @@ table = try $ do
|
|||
caption <- case frontCaption of
|
||||
Nothing -> option (return mempty) tableCaption
|
||||
Just c -> return c
|
||||
-- renormalize widths if greater than 100%:
|
||||
let totalWidth = sum widths
|
||||
let widths' = if totalWidth < 1
|
||||
then widths
|
||||
else map (/ totalWidth) widths
|
||||
return $ do
|
||||
caption' <- caption
|
||||
heads' <- heads
|
||||
lns' <- lns
|
||||
return $ B.table caption' (zip aligns widths) heads' lns'
|
||||
return $ B.table caption' (zip aligns widths') heads' lns'
|
||||
|
||||
--
|
||||
-- inline
|
||||
|
|
Loading…
Add table
Reference in a new issue