prettier: [For v3+ / breaking change] Should we change how to handle line breaking surrounded by han/kana when `proseWrap` is `always`
Prettier 2.8.8 Playground link
# Options (if any):
--print-width=40 --prose-wrap=always
Input:
English 日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語 English
Output:
English 日本語日本語日本語日本語日本語日
本語日本語日本語日本語日本語日本語日本語
日本語日本語日本語日本語日本語日本語
English
Expected behavior:
English
日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語
English
Almost all Markdown renderers always treat the line breaking as space even if han/kana is included in characters surrounding it.
English 日本語日本語日本語日本語日本語日
本語日本語日本語日本語日本語日本語日本語
日本語日本語日本語日本語日本語日本語
English
↓
English 日本語日本語日本語日本語日本語日 本語日本語日本語日本語日本語日本語日本語 日本語日本語日本語日本語日本語日本 English
Which should Prettier consider is more important, the appearance of formatted documents, or the compatibility with Markdown renderers?
It is OK for me to keep the current behavior and ask authors of renderers to change their behavior.
Memo:
#3026 (the beginning of the nightmare) ↓ #5040 (mitigation for Korean) ↓ #11597 (mitigation) ↓ #14936 (fix for this issue)
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 25 (25 by maintainers)
I mean
Make sense.
@kachkaev I’m its author. I didn’t change the current behavior in the PR intentionally.
https://deploy-preview-11597--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEBRKBzANgSwM4AWABIKemgNOaB5UeVZdXbQzU-c4y9UetvgSADQgIABxg5oeZKACGAJxkQA7gAVZCCSilYFUgJ4SBAIxlSwAazgwAylIC2cADI4ocZDBkBXOIeNmLloSZOGK4eXiBwNgZwACbRMfZSmO5SGHAAYhAyNlIwopjIIFLuMBD8IAQwNlgA6gQ48HgBYHCWavU4AG71OgVgePogTnhwMjBKxhjZyABmmsMCAFZ4AB6WQVhwAIruEPAzc2EBMsMyBdkyptGKUGVCMk4w1TjRMLxIACwADAJ3EMPVxiEBU02j0ZQAjjt4ONhOpCngALTOGIxMoyOCQnDo8YpKZIWZYeYgYY2HAhTwCPDrLZQlz4g4CGBSAxPF5vABMjOMOFwmAAwhAbHjClgsGV3MMACrM9QEokdTwASSgcVgljA9xEAEEVZYYDoNvtCXAAL4moA
This is because there was no agreement to change the behavior.
I fixed just the problem Prettier inserts spaces between han/kana and alphanumeric not separated by a space in that PR.