markdown-mode
markdown-mode copied to clipboard
`markdown-toggle-markup-hiding` misaligns tables in `gfm-mode`
Expected Behavior
When gfm-mode
is active, markdown-toggle-markup-hiding
should render tables or at least keep columns aligned.
Actual Behavior
If the contents of the tables change their width when markdown-toggle-markup-hiding
is invoked, then the table becomes misaligned.
Steps to Reproduce
In gfm-mode
input the following table.
| Foo | Bar |
|-------|-------|
| `foo` | `bar` |
| `foo` | baz |
Note that in normal viewing it is aligned.
Invoke markdown-toggle-markup-hiding
, and note that it now becomes misaligned.
Software Versions
Markdown Mode 20180124.138 GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26) of 2018-02-12 Arch Linux
Remarks
I am aware that this is a tall request, but I felt that it should at least be documented.
This is already documented in README:
The table editing functions try to handle markup hiding correctly when calculating column widths, however, columns containing hidden markup may not always be aligned properly.
You may see the discussion in #266 for some technical details concerning this behavior.
@saf-dmitry For text in a table, do you think it would work if we set the display
property to " "
(a space) instead of setting the invisible
property?
@jrblevin Nice idea, but this can result in an ugly layout, e.g. markup hiding will turn the following table cells
| [Link](www.example.com) | **foo**, *bar* |
into this
| Link | foo , bar |