aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 7b1341af4..77c3a1016 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -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