Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown-toggle-markup-hiding misaligns tables in gfm-mode #324

Open
matthew-piziak opened this issue Apr 3, 2018 · 3 comments
Open

markdown-toggle-markup-hiding misaligns tables in gfm-mode #324

matthew-piziak opened this issue Apr 3, 2018 · 3 comments

Comments

@matthew-piziak
Copy link

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.

image

Invoke markdown-toggle-markup-hiding, and note that it now becomes misaligned.

image

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.

@saf-dmitry
Copy link
Contributor

saf-dmitry commented Apr 4, 2018

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.

@jrblevin
Copy link
Owner

@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?

@saf-dmitry
Copy link
Contributor

@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  |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants