Line breaking in a code span can break the block structure
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
- 25/100
Hướng nghiên cứu
Tái hiện các trường hợp được báo cáo bằng các lệnh cmark trong issue, đặc biệt là các đầu vào code span được render bằng --width 3. Đọc các quy tắc ngắt dòng được đề xuất và so sánh chúng với hành vi parsing và rendering của CommonMark. Được xem là hoàn tất khi việc ngắt dòng bên trong code span không còn làm thay đổi heading, paragraph, fenced code block hoặc cấu trúc danh sách.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In CommonMark rendering, line breaking in a code span can break the block structure. Here are just a few examples:
$ printf '`xx --- xx`' | cmark -t commonmark --width 3 | cmark -t html
<h2>`xx</h2>
<p>xx`</p>
$ printf '`xx ``` xx`' | cmark -t commonmark --width 3 | cmark -t html
<p>`xx</p>
<pre><code>xx`
</code></pre>
$ printf '`xx + x xx`' | cmark -t commonmark --width 3 | cmark -t html
<p>`xx</p>
<ul>
<li>x
xx`</li>
</ul>
In case anyone wants to discuss, here is my attempt to specify how I think CommonMark rendering should work:
Line breaking is only implemented inside a paragraph, not inside a heading or an HTML block.
Except inside raw HTML (which I've not thought about), any group of consecutive whitespace characters will turn into a single space or a newline followed by the current line prefix.
Break each line at the last breakable space that doesn't make the line too long. So a line will be wider than the specified width only if it contains no breakable spaces.
In code spans a space is breakable if and only if the following group of non-space characters does not match any of the following Perl regular expressions:
/^[#*-=_]+$/ thematic break, heading
/^(```|~~~)/ fenced code block
/^[<>]/ HTML block, block quote
/^[*+-]$/ list item
/^[0-9]+[).]$/ list item
In textual content all spaces are breakable. A backslash is inserted for the following groups of characters:
/[*<[\\_`]/ escape, code, emphasis, links, images, raw HTML
/[&][#A-Za-z]/ entity or numeric character reference
/^[#*-=_]+$/ thematic break, heading
/^(```|~~~)/ fenced code block
/^[<>]/ HTML block, block quote
/^[*+-]$/ list item
/^[0-9]+[).]$/ list item
In these expressions, ^ means the start of a line (perhaps following a line prefix) and $ means space or the end of the line.
The backslash is inserted in front of each group, except in the last case, where it is inserted in front of the parenthesis or dot.
I've almost certainly forgotten something in there.
- Ngôn ngữ chính
- C
- Star
- 2k
- Fork
- 698
- 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/cmark
-
Incorrect `parser->offset` advancement for closing fenced code blocks in `parse_code_block_prefix`Có thể đã có người làm @cpruijsen đã nhận 24 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
commonmark/cmark#590 · 3 bình luận ·
-
API documentation is missing an explanation of CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_CUSTOM_INLINEĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commonmark/cmark#441 · 2 bình luận ·
-
Inline code languageĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
commonmark/cmark#626 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
commonmark/cmark#624 ·
-
Single-space blank line evicts a list-item continuationCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
commonmark/cmark#618 ·
Tất cả issue của commonmark/cmark
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Policy query leaks host primary block (BSL_PrimaryBlock_deinit skipped) on two early-exit pathsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NASA-AMMOS/BSL#355 ·
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 78/100
arancormonk/dsd-neo#660 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: remote-ls --updates reports up-to-date OCI refs because it ignores deployed Alt-idCó thể đã có người làm @Joao-kouznetz đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
#242 leftovers: dated narrative and shas in the social-features test planCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
EchoTools/nevr-runtime#264 ·
Maintainer thường phản hồi trong vòng 1 ngày