-
Notifications
You must be signed in to change notification settings - Fork 81
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
Bug: "Remove Multiple Spaces" rule ignores >1 spaces inside of tables #951
Comments
Hey @redactedscribe . I am not sure that this is a bug. If I recall, the reason tables are not affected is because removing multiple spaces in a table removes styling added to those tables like making sure all rows have the same length. I am not sure I would want to change that behavior since it could mess up table styling which I have no intention of supporting in the Linter. |
I understand your concerns @pjkaufman, however I do not style my tables so fixing >1 spaces would not be a problem in my case. (Edit: By style I mean align the table using spaces. I do "style" it by having a space before and after vertical bars, which might require some support and is something I did not consider at first.) Is "Remove Multiple Spaces" the only rule which doesn't run on tables? If so, Linter already supports tables you could say, it just doesn't touch spacing. If that holds true, then instead of hardcoding skipping over the "Remove Multiple Spaces" rule, we could have an "Ignore rules from table linting" option with a list filter where we can add rule aliases (with "remove-multiple-spaces" listed by default). This would then at least give us the option to remove "remove-multiple-spaces" if we don't want space-aligned tables in source. |
The issue with removing multiple spaces is that it will remove spaces before and after text in a table as well. It can be handled, but that would take treating tables as special and then handling them as a one off. That is possible, but it would likely be some time before I could take a look at it assuming there is not a lot of desire for this from the community. However, I would be fine with accepting a PR for this. |
It would mess with the following table styling: | Foo | Bar |
| --------- | -------------------------------------------------------------------------- |
| Hello | World! Some double spaces and a link [here is link text1](link_here). | would become | Foo | Bar |
| --------- | -------------------------------------------------------------------------- |
| Hello | World! Some double spaces and a link [here is link text1](link_here). | |
I understood this, which is why I suggested keeping the behaviour the same but letting users who don't want/need nicely spaced tables in their Markdown to opt out.
My assumption would be that some users do format their tables nicely, and others don't bother (which my guess would be the majority, but I don't know). For those that don't bother, I assume they'd also want them to be spaced like the rest of their file.
Thanks for being open to a PR. |
Describe the Bug
The "Remove Multiple Spaces" rule does not work inside of tables.
How to Reproduce
Steps to reproduce the behavior:
The example contains links only for the purposes of showing that Linter can and does process content inside of tables, but for some reason just ignores processing double spaces.
Expected Behavior
Double spaces should be removed from everywhere in the note body (unless "Trailing Spaces" > "Two Space Linebreak" is enabled -- or any other space rule which should override).
Expected output if applicable:
Device
Additional Context
Assumed "Remove Multiple Spaces" rule would be under the Spacing tab in the settings, but in fact it is under Content. Perhaps it should be under Spacing?
Thanks.
The text was updated successfully, but these errors were encountered: