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
Markdown undesirable formatting behaviour when new text added to paragraph #16223
Comments
Can follow the issue template? |
Hi @sosukesuzuki. Sorry about that, I did try to use the playground to reproduce the error, but I couldn't see how to format the file. I don't know if the formatting is supposed to happen automatically? I pasted in some dummy text and I set the print width to 60 but nothing happened. I have attached a screenshot showing this. |
@ncasdpo you need to set Here is what I tried: Initial formattingPrettier 3.2.5 --parser markdown
--prose-wrap always Input: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Output: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
Edit in the middle of the paragrpahI copied the result into the left column and added a few Prettier 3.2.5 --parser markdown
--prose-wrap always Input: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
Output: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis asdf
asdf asdf asdf asdf asdf asdf asdf asdf asdf nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.
The result looks correct. Can you please check if you are using Prettier in your editor or if it’s some other formatter that you run there? Prettier should behave the same way as in the Playground. |
In a markdown file, if you have written out a new single line of text, the lorem ipsum paragraph in the recorded example, the formatting is fine.
But when you add text into the middle of the paragraph, the line breaks from the initial formatting will be kept instead of reformatting the whole paragraph again. Please see the screen recording here:
https://github.com/prettier/prettier/assets/153771236/6fd827b2-2e20-47df-88a0-2a62381ca0d2
The text was updated successfully, but these errors were encountered: