aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-01-16 23:13:33 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-01-16 23:13:33 -0800
commitd987a9d1142c092798694c650856ed0c371641ac (patch)
treed9080460cb01462fec9c898085151d6b5d660f67 /src/Text/Pandoc
parent24acb714c185139ef3a02a7437cd1c64f85c0198 (diff)
downloadpandoc-d987a9d1142c092798694c650856ed0c371641ac.tar.gz
Markdown writer: fix cell width calculation.
Previously we could get ever-lengthening cell widths when a table was run repeatedly through `pandoc -f markdown -t markdown`. This patch stabilizes the relative cell widths. Closes #4265.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 08dff2c4e..c8b3a1526 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -701,7 +701,7 @@ pandocTable opts multiline headless aligns widths rawHeaders rawRows = do
let columns = transpose (rawHeaders : rawRows)
-- minimal column width without wrapping a single word
let relWidth w col =
- max (floor $ fromIntegral (writerColumns opts) * w)
+ max (floor $ fromIntegral (writerColumns opts - 1) * w)
(if writerWrapText opts == WrapAuto
then minNumChars col
else numChars col)