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.
This commit is contained in:
parent
7df0710094
commit
247d8e8001
1 changed files with 2 additions and 2 deletions
|
@ -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 "|" <>
|
||||
|
|
Loading…
Reference in a new issue