Giter Club home page Giter Club logo

Comments (5)

pjkaufman avatar pjkaufman commented on June 24, 2024 1

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.

from obsidian-linter.

pjkaufman avatar pjkaufman commented on June 24, 2024

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.

from obsidian-linter.

redactedscribe avatar redactedscribe commented on June 24, 2024

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.

from obsidian-linter.

pjkaufman avatar pjkaufman commented on June 24, 2024

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). |

from obsidian-linter.

redactedscribe avatar redactedscribe commented on June 24, 2024

The issue with removing multiple spaces is that it will remove spaces before and after text in a table as well.

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.

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.

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.

However, I would be fine with accepting a PR for this.

Thanks for being open to a PR.

from obsidian-linter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.