diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-12 15:16:16 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-12 15:16:16 -0800 |
commit | e86c337356fc723e366e5f0d6209205bcffe88f3 (patch) | |
tree | 69b956db208aa9f687d8d6582ce08b00214f3e08 /src/Text/Pandoc | |
parent | 7d23031b904d9371de8ce9ffe943e426bd5056c8 (diff) | |
download | pandoc-e86c337356fc723e366e5f0d6209205bcffe88f3.tar.gz |
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/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 4 |
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'') |