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

Removed excessive spaces after line prefixes for unordered lists in Markdown #15526

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TomasLudvik
Copy link

@TomasLudvik TomasLudvik commented Oct 20, 2023

Description

This change fixes excessive spaces after line prefixes for unordered lists in Markdown. Closes #5019.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@TomasLudvik TomasLudvik changed the title removed excessive spaces after line prefixes for unordered lists in Markdown Removed excessive spaces after line prefixes for unordered lists in Markdown Oct 20, 2023
@TomasLudvik
Copy link
Author

Hello @fisker, what can I do to push this PR forward?

@grossmannmartin
Copy link

Hi,
this seems like a really important fix. What has to be done to push this forward?

@LucasOe
Copy link

LucasOe commented Jan 8, 2024

Any progress on this? I would really like to see this feature!

@glenn-jocher
Copy link

@TomasLudvik @fisker what's the status on this PR? This is the one problem preventing Prettier adoption at our org.

@TomasLudvik
Copy link
Author

@glenn-jocher It is waiting for review from @fisker or @sosukesuzuki as I am not a maintainer of this repo.

@grossmannmartin
Copy link

Hi @fisker, @sosukesuzuki
Any news regarding this issue?

@Lixquid
Copy link

Lixquid commented Apr 4, 2024

Hi @fisker, @sosukesuzuki, I really hate to pester, but this is causing some immense grief with having to manually remove the extra spaces after the markers, is there anything anyone can do to push this forward?

The deviation fights with basically every example and other linting tool out there as shown in a comment in #5019 which makes it a near impossible sell to match the other way round.

@glenn-jocher
Copy link

@fisker @sosukesuzuki please merge this PR as soon as you can without further delay.

jace added a commit to hasgeek/funnel that referenced this pull request Jun 7, 2024
Prettier messes up unordered lists due to prettier/prettier#5019, pending a fix in prettier/prettier#15526
vidya-ram pushed a commit to hasgeek/funnel that referenced this pull request Jun 10, 2024
* Copy-edited POSH policy

* Remove extra spaces

* Ignore Markdown files in Prettier
Prettier messes up unordered lists due to prettier/prettier#5019, pending a fix in prettier/prettier#15526
@beefchimi
Copy link

@fisker @sosukesuzuki another bump for getting this PR merged 🙏

@fisker
Copy link
Member

fisker commented Jun 13, 2024

I'm not familiar with the markdown spec, but will this break CommonMark?

@fisker
Copy link
Member

fisker commented Jun 13, 2024

@kachkaev mentioning you since you are involved in #3990

@kachkaev
Copy link
Member

kachkaev commented Jun 14, 2024

I'm not sure about this change TBH. If I understand it correctly, it essentially ignores tabWidth: 4 and renders lists as tabWidth: 2. Shouldn’t folks do this instead?

{
  "tabWidth": 4, // prerequisite
  "overrides": [
    {
      "files": "*.md",
      "options": {
        "tabWidth": 2
      }
    }
  ]
}

That said, I’m not certain enough to say that this PR is wrong. I’m just confused about it’s best to ignore tabWidth value rather than configure it to work as expected.

@glenn-jocher
Copy link

glenn-jocher commented Jun 16, 2024

@fisker @kachkaev guys the #5019 bug that this PR fixes has 130 upvotes in #5019 (comment), many many users are facing problems that this PR fixes.

The basic problem is that prettier --tab-width=4 is strangely creating spaces after dashes in lists, which no one is expecting and leaves all of us unable to use prettier for formatting markdown in our projects. This PR resolves this problem correctly per my testing and operates correctly in about 300 markdown pages for Ultralytics docs.

Screenshot 2024-06-16 at 15 24 30

@glenn-jocher
Copy link

glenn-jocher commented Jun 20, 2024

@fisker @sosukesuzuki @kachkaev friendly bump to please merge this. Our 80k-star organization is pending this PR to apply prettier to all our 300 MkDocs pages, it would really help us a lot. Currently we are considering installing prettier directly from @TomasLudvik fork instead, but this is much slower, i.e. npm install --global TomasLudvik/prettier

@MartenBE
Copy link

MartenBE commented Jun 23, 2024

I'm not familiar with the markdown spec, but will this break CommonMark?

@fisker Actually, this PR makes prettier closer to what Commonmark shows in its tutorials: see #5019 (comment) . @kachkaev , this PR in facts works together with tabwidth instead of a replacement. The indent is handled by tabwidth, but the spaces behind the marker should be handled independent of this as that is not an indentation (see comment above by @glenn-jocher ).

@glenn-jocher
Copy link

@fisker friendly nudge here to please merge this PR when you can, thank you!

F-loat added a commit to stardustai/docs-api that referenced this pull request Jul 8, 2024
wait the prettier issue be fixed prettier/prettier#15526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab width should not affect text alignment after the bullet points in Markdown lists
9 participants