Closed wyldphyre closed 6 years ago
Confirm that this is a bug and it occurs only in markdown mode.
Also here one thing should be considered: when some row have more columns than other table, should column be deleted in this row or whole table should have 1 more column? In GFM priority goes to the header row, so if any other row has more columns, they will not be displayed, however this might be not very convenient for table editing.
Personally, I don’t think I’d want a new column created. I ran into this because I wanted to actually have a pipe character in my cell data, but that obviously makes parsing quite difficult, and probably shouldn’t be allowed.
In markdown pipe character is allowed, but you need to escape it with "\". In org, pipe characters aren't allowed.
\ | Piped\ | |
---|---|---|
\ |
Hi @wyldphyre,
I've fixed this bug. PR: https://github.com/rpeshkov/vscode-text-tables/pull/35
In this fix I implemented second approach for now. That's the one where "whole table should have 1 more column". I'll raise another issue with lower priority to add an option which will allow to select another algorithm of reformatting.
Once all checks will complete and build will be successful, I'll merge this PR and update extension in marketplace.
Thank you
If a cell contains a pipe character then the "Format Under Cursor" command doesn't do anything. It would be nice if it was able to work this out, but maybe it isn't possible.
Here is an example of table that won't format: