Ensure that trailing/leading Unicode whitespaces/Vertical Tab/Form Feed/No-break Space in paragraphs are not removed
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/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ệ
- c, javascript
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start with the CommonMark 0.31.2 paragraphs section and the linked commonmark.js issue and pull request, then compare the documented examples with the cmark and micromark behavior described here. Done means the specification clearly defines whether Unicode whitespace, vertical tabs, form feeds, and no-break spaces are preserved or stripped in paragraph boundaries.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
https://github.com/commonmark/commonmark.js/issues/261
https://github.com/commonmark/commonmark.js/pull/289
https://spec.commonmark.org/0.31.2/#paragraphs
Leading spaces or tabs are skipped:
Example 222aaa bbb<p>aaa bbb</p>Lines after the first may be indented any amount, since indented code blocks cannot interrupt paragraphs.
Example 223aaa bbb ccc<p>aaa bbb ccc</p>However, the first line may be preceded by up to three spaces of indentation. Four spaces of indentation is too many:
Example 224aaa bbb<p>aaa bbb</p>aaa bbb<pre><code>aaa </code></pre> <p>bbb</p>Final spaces or tabs are stripped before inline parsing, so a paragraph that ends with two or more spaces will not end with a hard line break:
Example 226aaa bbb<p>aaa<br /> bbb</p>
The specification doesn't mention non-ASCII Unicode whitespaces, no-break space, form feed, or vertical tab, but some implementations treats them like ASCII space and tab, and remove trailing or leading ones in paragraphs.
cmark seems to remove at least U+00A0 NBSP, (but not U+3000 or U+2003) preserves U+00A0 too
echo "`u{a0}a`u{a0}" | ./cmark | hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 3c 70 3e c2 a0 61 c2 a0 ┊ 3c 2f 70 3e 0a │<p>××a××┊</p>_ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
However cmark removes trailing Form Feeds and Vertical Tabs.
PS> echo "guard`n`n`vVT`v`v`n`fFF`f`f`nend" | hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ ef bb bf 67 75 61 72 64 ┊ 0a 0a 0b 56 54 0b 0b 0a │×××guard┊__•VT••_│
│00000010│ 0c 46 46 0c 0c 0a 65 6e ┊ 64 0d 0a │_FF___en┊d__ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
PS> echo "guard`n`n`vVT`v`v`n`fFF`f`f`nend" | ./cmark | hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 3c 70 3e 67 75 61 72 64 ┊ 3c 2f 70 3e 0a 3c 70 3e │<p>guard┊</p>_<p>│
│00000010│ 0b 56 54 0a 0c 46 46 0a ┊ 65 6e 64 3c 2f 70 3e 0a │•VT__FF_┊end</p>_│
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
commonmark.js removes all characters trimmed by trim() of JS.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar
micromark doesn't touch other than ASCII space (U+0020) or tab (U+0009).
Other implementations:
- Ngôn ngữ chính
- Python
- Star
- 5.1k
- Fork
- 359
- 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ó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
commonmark/commonmark-spec#845 · 1 reaction ·
-
Độ 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 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue Stellar Wave trivial
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
IBM/ai-atlas-nexus#295 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Hochfrequenz/aibap.mcp#578 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mishraprafful/multihull#150 ·
Maintainer thường phản hồi trong vòng 1 ngày