-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Copy link
Labels
help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:markdownIssues affecting MarkdownIssues affecting Markdownlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
This is a nested list as given in CommonMark tutorial:
* Item
1. First Subitem
2. Second Subitem
* Item
- Subitem
- Subitem
* Item
It is formatted like this with --tab-width=4 (four is a safer value than two):
- Item
1. First Subitem
2. Second Subitem
- Item
- Subitem
- Subitem
- Item
I expected this output (just * replaced with -):
- Item
1. First Subitem
2. Second Subitem
- Item
- Subitem
- Subitem
- Item
Reasoning:
- It's the natural form in which nested lists are written.
- I believe it would be less work for Prettier.
- It is similarly easy to look at. There will be personal preferences here but I don't think Prettier generally worries about beautification too much, as long as the code is "correct" (whatever that means in Markdown), reasonably formatted and consistent with common practices.
- It feels illogical to me to apply
--tab-widthboth before and after the bullet, also, there is an internal inconsistency when setting tab width greater than 5 as you can see in--tab-width=5vs.--tab-width=6. - As a small bonus, the new formatting would be compatible with markdownlint.
I know that nested lists are one of the trickiest parts of Markdown so maybe I'm missing some non-obvious reason why list texts are aligned the way they are. If that was a purely aesthetic decision, I wanted to create this issue as a counter-argument as I believe simplicity and consistency are generally preferred in Prettier over attempts at beautification.
(As a side note, I ran Prettier over hundreds of Markdown files in our repo and it did a great job overall, better than I expected. That is admirable with virtually zero config options. 👍)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:markdownIssues affecting MarkdownIssues affecting Markdownlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.