Description on how soft line breaks are treated in browsers doesn't consider the combination of Firefox & Chinese/Japanese text and should be improved
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- css, html
- Ambito
- documentation
Direzione di ricerca
Start with the soft-break section at spec.commonmark.org/0.30/#softbreak and compare its wording with CSS Text Module 4's line-break transformation rules. Reproduce the linked CodePen and Dingus examples in Firefox and Chromium-based browsers, including the Chinese, Japanese, and Korean cases. Done means the specification text accurately describes browser-dependent rendering and the relevant language behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
https://spec.commonmark.org/0.30/#softbreak
The description on a soft line break looked ambiguous or questionable for me.
A soft line break may be rendered in HTML either as a line ending or as a space.
Does it mean Markdown-to-HTML converters are allowed to convert a soft line break in Markdown to either of "\n" (or possibly "\r" or "\r\n") or " " in HTML? Generally "may" in specifications means "is allowed to and does not have to" (RFC 2119) and confused me.
I have no idea when "a soft line break is rendered in HTML as a line ending". Is it when whitespace: preserve or some other values is passed in CSS? Also is there a case when a soft line break is rendered in HTML as other than a line ending or a space?
The result will be the same in browsers.
This is wrong. How "\n" in HTML is rendered differs among browsers when Chinese or Japanese are contained.
https://drafts.csswg.org/css-text-4/#line-break-transform
Then any remaining segment break is either transformed into a space (U+0020) or removed depending on the context before and after the break. The rules for this operation are UA-defined in this level.
This means how a soft line break is rendered depends on browsers' implementations.
In languages that have no word separators, such as Chinese, “unbreaking” a line requires joining the two lines with no intervening space.
這個段落是那麼長,
在一行寫不行。最好
用三行寫。
↓
這個段落是那麼長,在一行寫不行。最好用三行寫。
Only Firefox follows this recommendation as of now. (However, spaces are inserted like the other browsers when copied and pasted on somewhere else!)
https://codepen.io/tats-u/pen/YzdKKyN
<p lang="zh-Hant-tw">這個段落是那麼長,
在一行寫不行。最好
用三行寫。</p>
↑Firefox (intended)
↑Edge (WebKit / Blink / IE; not intended; space after "," is selected)
https://codepen.io/tats-u/pen/poQQVyR (what kind of CJK letters remove a newline between them? → Korean is treated like alphanumeric characters unlike Japanese)
<p>잘자
(
잘자
)
잘자
잘자
あああ
(
あああ
)
ああああ
1
ああ
ああ
。
1
。</p>
↑ FIrefox
↑Edge (and other WebKit & Blink based browsers / IE)
↑Firefox (looks natural)
↑Edge (Wekit / Blink / IE; doesn't look natural)
From these results, we can conclude only "\n" between Chinese or Japanese letters (han/kana) or punctuation marks is removed instead of replaced with " " in Firefox.
Also,
The result will be the same in browsers.
This sentence must be replaced with like:
The result will follow the CSS Text Module specification and might depend on browsers (but should be same in languages that use a space to segment words).
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 360
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di commonmark/commonmark-spec
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
commonmark/commonmark-spec#843 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
commonmark/commonmark-spec#838 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
commonmark/commonmark-spec#728 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
commonmark/commonmark-spec#847 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
commonmark/commonmark-spec#844 · 5 commenti · 1 reazione ·
Tutte le issue di commonmark/commonmark-spec
Issue simili
-
Project submission:Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
slavakurilyak/awesome-ai-agents#845 ·
I maintainer di solito rispondono entro 1 giorno
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadifficulty:2 enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
MakazhanAlpamys/Soup#2178 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
scverse/rapids-singlecell#854 ·
I maintainer di solito rispondono entro 1 giorno
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLForse già presa @ninglinLiu l’ha presa oggi. Apertaarea:frontend backend:slang bug direction:input
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 13 giorni