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

If row/column data contains a pipe character then Format Under Cursor doesn't work #33

Closed
wyldphyre opened this issue May 1, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@wyldphyre
Copy link

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:

header 1 Header 2
Clean Content 0.05
Content with a character
@rpeshkov
Copy link
Owner

rpeshkov commented May 1, 2018

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.

@rpeshkov rpeshkov added the bug Something isn't working label May 1, 2018
@wyldphyre
Copy link
Author

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.

@rpeshkov
Copy link
Owner

rpeshkov commented May 1, 2018

In markdown pipe character is allowed, but you need to escape it with "\". In org, pipe characters aren't allowed.

|Piped|
|

@rpeshkov
Copy link
Owner

rpeshkov commented May 2, 2018

Hi @wyldphyre,

I've fixed this bug. PR: #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.

@wyldphyre
Copy link
Author

Thank you

rpeshkov added a commit that referenced this issue May 3, 2018
* Fixed markdown parser

Fixes #33. Problem was caused by parser, which didn't set appropriate column widths when separator row is present in table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants