Skip to content

[v4+ / breaking change] Always treat newline between non-punctuation han/kana and alphanumeric as space when proseWrap is always #14936

@tats-u

Description

@tats-u

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.


Need to be monitored:


Subissue (Note: most readers will want a fix for this instead):


Memo:

#3026 (the beginning of the nightmare)

#5040 (mitigation for Korean)

#11597 (mitigation)

#14936 (fix for this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions