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

Prettier formats 3-level bullet list with no content to thematic break #13779

Open
xiaq opened this issue Nov 2, 2022 · 2 comments
Open

Prettier formats 3-level bullet list with no content to thematic break #13779

xiaq opened this issue Nov 2, 2022 · 2 comments
Labels
lang:markdown Issues affecting Markdown type:bug Issues identifying ugly output, or a defect in the program

Comments

@xiaq
Copy link

xiaq commented Nov 2, 2022

Prettier 2.7.1
Playground link

Input:

This is a 3-level bullet list with no content:

- - *

Output:

This is a thematic break:

- - -

Expected behavior:

Don't format - - * to - - -.

In general, for any N-level bullet list with no content, avoid using 3 consecutive -s. This can be done by alternating with * or +, as is done in the input.

@xiaq
Copy link
Author

xiaq commented Nov 3, 2022

Found another similar case:

* --

Prettier formats this to:

- --

Which is again parsed as a thematic break.

@kachkaev
Copy link
Member

kachkaev commented Nov 4, 2022

Thanks for reporting this bug @xiaq 👍 Interesting edge case indeed!

@kachkaev kachkaev added type:bug Issues identifying ugly output, or a defect in the program lang:markdown Issues affecting Markdown labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:markdown Issues affecting Markdown type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

2 participants