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)

Most upvoted comments

I mean

Newline and space will be able to be interchanged with each other unconditionally.


Continuous Chinese and Japanese won’t be broken (like Korean)

Make sense.