You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow whitespace to be removed when rendering tables
## Details
Adds new pipe_table `cell` option value `trimmed`.
This new option functions nearly identically to the padded option
however when computing the visual width of a cell we subtract out any
trailing spaces.
Based on this new calculation cells can now have a negative offset,
meaning they occupy too much space and that space needs to be removed.
When this situation is encountered we add a new `extmark` that simply
applies a conceal to the end of the cell equal to the size of the
negative offset.
One other thing to note is for the trimmed style we ignore the width of
the delimitter row since users lining up tables visually and adding
spaces will also make the delimitter row line up. We add spaces at the
end of the overlay virtual text to hide any text that extends beyond the
computed widths.
Minor other changes:
- `str.leading_spaces` -> `str.spaces` where first argument is either
`start` or `end`
- `str.spaces` -> `str.pad`
- Appending strings together is no longer done in `str` module and is
instead handled inline to avoid any start vs end type logic
0 commit comments