Description on how soft line breaks are treated in browsers doesn't consider the combination of Firefox & Chinese/Japanese text and should be improved
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- css, html
- Lĩnh vực
- documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 5.2k
- Fork
- 360
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commonmark/commonmark-spec
-
NBSP written two different waysĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
commonmark/commonmark-spec#843 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
commonmark/commonmark-spec#838 · 2 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
commonmark/commonmark-spec#728 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
commonmark/commonmark-spec#847 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
commonmark/commonmark-spec#844 · 5 bình luận · 1 reaction ·
Tất cả issue của commonmark/commonmark-spec
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
AstrBotDevs/AstrBot#10720 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Đang mởcause/upstream comp/cli P2 provider/other tool/file type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#143900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
WLAN-Pi/wlanpi-profiler#341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày