Skip to content

Conversation

tats-u
Copy link
Contributor

@tats-u tats-u commented Sep 25, 2024

Closes #16710

Description

The 2nd safest part of #15081
All HTML browsers (even Firefox) insert space between Chinese/Japanese and others.

https://wpt.fyi/results/css/css-text/line-breaking?label=master&label=experimental&aligned&q=segment-break-transformation- (See only those that all browsers pass)

FYI, FIrefox treats the following characters in BMP and SSP (Plane 0-1) as Chinese/Japanese:

https://github.com/tats-u/cj-newline-test/?tab=readme-ov-file#result-in-firefox

The current behavior of Prettier (3.x) with proseWrap always conflicts with it.

This change will help Markdown documents converted to HTML or JS components to be rendered more correctly by browsers.

Note: this doesn't affect on line breaks between Chinese/Japanese and Korean letters because a space and a line break there is equivalent.

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@tats-u tats-u force-pushed the markdown-newline-html-pre1 branch from 8ae9377 to 7a095e4 Compare September 28, 2024 12:39
@tats-u
Copy link
Contributor Author

tats-u commented Sep 28, 2024

This force push is just a rebase to main.
I will modify print-width.js to stop Prettier from wrap lines even between Chinese/Japanese characters.

@tats-u tats-u changed the title Markdown: Don't break a line at the place between Chinese or Japanese and others Markdown: Don't break a line at the place around Chinese or Japanese characters Sep 28, 2024
@tats-u tats-u force-pushed the markdown-newline-html-pre1 branch from 2662898 to 91570bd Compare September 28, 2024 16:37
@tats-u tats-u marked this pull request as ready for review September 28, 2024 16:37
Comment on lines +37 to +38
かつてはワ行のワ、ヰ、ヱ、ヲに濁点を付して [v]
音を表現すること(ワ゛、ヰ゛、ヱ゛、ヲ゛)も行われたが、一般的にはならなかった。
tats-u and others added 3 commits October 1, 2024 23:56
Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com>
@tats-u tats-u requested a review from sosukesuzuki October 5, 2024 09:33
Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM

@sosukesuzuki sosukesuzuki requested a review from fisker October 6, 2024 02:29
@fisker fisker merged commit 0a4c1e3 into prettier:main Oct 18, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown: Disable breaking a line at the place around Chinese or Japanese characters even when proseWrap is always
4 participants