aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-03-31 22:34:00 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-03-31 22:34:00 -0700
commit247d8e80015ac8bc1e2968faf00dd944386ce9d4 (patch)
tree747ab88439c30fe5b14dbb6840ec5ed9575223eb /src/Text/Pandoc/Writers
parent7df0710094b521c52f7e312751fe90890768f76c (diff)
downloadpandoc-247d8e80015ac8bc1e2968faf00dd944386ce9d4.tar.gz
Markdown writer: ensure consistent padding for pipe tables.
Previously there was no space between text and bar in right-aligned table cells. This commit also ensures space on both sides for centered cells. Closes #6240.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 5c264aa30..58299f5ea 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -669,8 +669,8 @@ pipeTable :: PandocMonad m
pipeTable headless aligns rawHeaders rawRows = do
let sp = literal " "
let blockFor AlignLeft x y = lblock (x + 2) (sp <> y) <> lblock 0 empty
- blockFor AlignCenter x y = cblock (x + 2) (sp <> y) <> lblock 0 empty
- blockFor AlignRight x y = rblock (x + 2) (sp <> y) <> lblock 0 empty
+ blockFor AlignCenter x y = cblock (x + 2) (sp <> y <> sp) <> lblock 0 empty
+ blockFor AlignRight x y = rblock (x + 2) (y <> sp) <> lblock 0 empty
blockFor _ x y = lblock (x + 2) (sp <> y) <> lblock 0 empty
let widths = map (max 3 . maximum . map offset) $ transpose (rawHeaders : rawRows)
let torow cs = nowrap $ literal "|" <>