The Japanese language ban does not work in Chrome.

Asked 1 years ago, Updated 1 years ago, 124 views

While Firefox and safari have long and short "ts" restrictions, Chrome does not. Applying Word-break:break-strict; to body will break the line.How (where?) should I write (where?) to properly apply the prohibition in Chrome?

Chrome version is 56.0.2924.87 (64-bit), used in Windows 10.

Add

body{
 word-break:normal;
 word-wrap:break-word;
}

But it didn't work.

css google-chrome

2022-09-30 21:22

1 Answers

Chrome58 or later, lang="ja" attributes and line-break:strict seem to suppress line segmentation before long and sulky tones.

Currently, the CSS stipulates prohibition processing, etc. is CSS Text Module Level 3, so I looked into this.Also, as of December 2017, it is still a working draft, so it is not the final draft.

Long notes (-U+30FC) and small hiragana and katakana (e.g., -U+3085) are described in the line-break property.This specifies the strength of the so-called forbidden process and is lower than the word-break property that controls division within English words and so on.

The following breaks are forbidden in strict line breaking and allowed in normal and loose:

  • breaks before Japanese small kana or the Katakana-Hiragana prolonged soundmark: i.e.characters with the Unicode Line Break property CJ.

These characters are line-break:strict and line-break:normal and line-break:loose.If omitted, the line-break:auto states that UA is free to set forbidden characters, so I can understand that what Firefox included is not included in Chrome.

Conclusion 1: If you want to include long or small kana characters in the forbidden characters, you should specify line-break: strict.

However, specifying line-break:strict does not resolve the issue in Chrome.When compared to Test Suite where the prohibition process is going as expected, the lang="ja" attribute was used in the Test Suite.By specifying this, the prohibition of characters in question is now enforced.

We could not find a statement that the above forbidden characters are applied only when lang="ja", and in fact Firefox seems to be applied regardless of the lang attribute.However,

Authors should language-tag their content acurately for the best typographic behavior.

and It's written, so it's better to specify it.

Conclusion 2: lang="ja" should also be specified.

div {background-color:#afa;width:5em;}
None specified
<div>
Ask <br>
to have a good time
</div>
word-break —break-all
<div style="word-break:break-all">
Ask <br>
to have a good time
</div>
line-break —Strict
<div style="line-break: strict">
Ask <br>
to have a good time
</div>
lang = "ja"
<div lang="ja">
Ask <br>
to have a good time
</div>
lang = "ja" line-break: strict
<div lang="ja" style="line-break: strict">
Ask <br>
to have a good time
</div>


2022-09-30 21:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.