git.iko.soy/typeable/pandoc
on master help sign in
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.

commit247d8e80015ac8bc1e2968faf00dd944386ce9d4 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 31 Mar 2020, 22:34 (7 years ago) parent7df0710
1 file changed+2−2
src/Text/Pandoc/Writers/Markdown.hs+2−2
src/Text/Pandoc/Writers/Markdown.hs+2−2
@@ -669,8 +669,8 @@ pipeTable :: PandocMonad m
669669pipeTable headless aligns rawHeaders rawRows = do
670670 let sp = literal " "
671671 let blockFor AlignLeft x y = lblock (x + 2) (sp <> y) <> lblock 0 empty
672− blockFor AlignCenter x y = cblock (x + 2) (sp <> y) <> lblock 0 empty
673− blockFor AlignRight x y = rblock (x + 2) (sp <> y) <> lblock 0 empty
672+ blockFor AlignCenter x y = cblock (x + 2) (sp <> y <> sp) <> lblock 0 empty
673+ blockFor AlignRight x y = rblock (x + 2) (y <> sp) <> lblock 0 empty
674674 blockFor _ x y = lblock (x + 2) (sp <> y) <> lblock 0 empty
675675 let widths = map (max 3 . maximum . map offset) $ transpose (rawHeaders : rawRows)
676676 let torow cs = nowrap $ literal "|" <>