-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[For v3+ / breaking change] Should we change how to handle line breaking surrounded by han/kana when proseWrap
is always
#14936
Comments
proseWrap
is always
proseWrap
is always
proseWrap
is always
proseWrap
is always
proseWrap
is always
proseWrap
is always
👋 @tats-u, Is #11597 solve your issue? See blog post draft in the diff. This is change planned for 3.0. |
@kachkaev I'm its author. I didn't change the current behavior in the PR intentionally. 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. |
|
I tried in CodePen. HTML:
↓ Looks like in Firefox:
Copy & paste / Looks like in Chrome:
I also previewed this HTML in both browser and got the same result. <!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
あ
い
う
a
b
c
あ
。
a。
あ。
あ!
あ!
</body>
</html> https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
↑ I couldn't find where it's used.
|
I (or we) want to have a PR in time for the 3.0 release, or it'll be much more difficult to reach agreement on a fix. |
Omg v3 was suddenly released without any betas. Should we push this back to v4? |
I agree it's a bug. We can only change the space to a new line. |
@fisker Can't we do the opposite like HTML? |
I think so. |
@fisker
This is my plan. Can we go with it? |
I mean
Make sense. |
Thanks. Now that we have the specs, someone or I can try for a PR. |
Let's wait a bit longer for more maintainers to express their opinions before start. |
Okey dokey. |
By the way, if this is a bug, can we force a patch for it into v3.0.1 or 3.1, without waiting for v4? |
I forgot how it works in v2. Do we insert new lines? |
As of #5040, all of CJK used to be able to be split by hard-line. |
@fisker Should we still remove trailing or leading full-width spaces (U+3000)? /* or some classes */
p {
text-indent: -1em;
margin-left: 1em;
} |
I think we need keep it. |
This should be HTML whitespace. They can change. |
I continue with the current specs.
You say we should remove this line, right? prettier/src/language-markdown/utils.js Line 151 in 01d93c6
|
The CommonMark spec is Prettier's main reference point, so I agree this needs to be changed. |
@thorn0 Thanks for your approval. prettier/src/language-markdown/utils.js Line 151 in 01d93c6
I found this is innocent. |
I have started to use the hack since several weeks ago: ((U+FEFF))<SomeComponent />I *can* use Markdown with leading JSX like `<SomeComponent />` in MDX v1!
But Prettier removes the |
#15081 is now ready for battle tests. |
Any planned progress here and/or workarounds, other than disabling Prettier over |
Unfortunately suspended recently |
Prettier 2.8.8
Playground link
# Options (if any): --print-width=40 --prose-wrap=always
Input:
Output:
Expected behavior:
Almost all Markdown renderers always treat the line breaking as space even if han/kana is included in characters surrounding it.
↓
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)
The text was updated successfully, but these errors were encountered: