summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-12 15:16:16 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-12 15:16:16 -0800
commite86c337356fc723e366e5f0d6209205bcffe88f3 (patch)
tree69b956db208aa9f687d8d6582ce08b00214f3e08 /src
parent7d23031b904d9371de8ce9ffe943e426bd5056c8 (diff)
Pipe tables: use full text width for tables with wrapping cells.
Previously we computed the column sizes based on the ratio between the header lines and the text width (as set by `--columns`). This meant that tables with very short header lines would be very narrow. With this change, pipe tables with wrapping cells will always take up the whole text width. The relative column widths will still be determined by the ratio of header lines, but they will be normalized to add up to 1.0.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 2d7c12e99..b97a724a4 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1353,8 +1353,8 @@ pipeTable = try $ do
numColumns <- getOption readerColumns
let widths = if maxlength > numColumns
then map (\len ->
- fromIntegral (len + 1) / fromIntegral numColumns)
- seplengths
+ fromIntegral (len + 1) / fromIntegral (sum seplengths))
+ seplengths
else replicate (length aligns) 0.0
return (aligns, widths, heads', sequence lines'')