-
Notifications
You must be signed in to change notification settings - Fork 524
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
add support for tables without borders #643
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to see support for table formats added, but I think we're going to need to have this gated behind a feature flag. We can discuss the merits of default on or off, but I know not all Markdown engines support this syntax and it has a high risk of false positive matches.
hey @alerque, I added the flag Although I should point out that in this PR I transform the borderless table to a normal one before formatting it, so it gives the same result as before. As for default value of the flag I'll let you decide. Right now it's disabled by default. |
i.e. ``` header 1|header 2 --|-- data 1|data 2 ```
to fix tests
if is set to 1 we try to transform the borderless table to normal one
1d3e020
to
afd2110
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooo, now we're talking. Gated behind a default-off flag sounds better too me since the worry is with false positives messing people up when they aren't expecting this. Thanks especially for adding tests and docs!
Would you like me to squash merge this or would you like to go through and split this up a little different? The current commit list isn't going to be very informative to a user updating through their plugin manager. One squashed |
I think we can squash it if it's easier. Thank you for maintaining this plugin ❤️ P.S. tested it on some complicated tables and it worked better than prettier |
@gka I'm not really maintaining this, I'm just around the org to facilitate community contributions actually landing. Feel free to jump in! |
This seems like a valid table(at least in github):
rendered:
The solution in this pull request is to wrap all lines that don't have
|
at the beginning or the end.I also added range call support. It doesn't change the implementation but allows to call
TableFormat
while having the selection.