A list-table cell holding a paragraph is written tight and re-reads as plain
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
The issue identifies write_list_table as the writer that loses the distinction between Para and Plain; start by locating that function and comparing its cell separators with list_is_tight and the list writers. Reproduce the round trip with the supplied input using cargo run --bin pampa, then check that the x cell remains Para after writing and reading. No test file is named in the issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Since the CommonMark loose/tight change (370123a8aefb144ea32c8443c2ee0e1b32309e7d, #1098), a list-table row whose cells are separated by a blank line reads with Para cells. write_list_table writes a cell's first Plain and Para identically and never puts a blank line between cells, so the row comes back tight and the Para cell re-reads as Plain. Ordinary bullet lists keep the distinction (list_is_tight), so the loss is specific to the list-table cell writer.
Input:
$ printf -- '::: {.list-table}\n\n* * a\n * b\n\n* * x\n\n * ```\n code\n ```\n\n:::\n'
::: {.list-table}
* * a
* b
* * x
* ```
code
```
:::
Reader (the x cell is a Para):
$ printf -- '...' | cargo run --bin pampa -- 2>&1
[ Table ( "" , [] , [] ) (Caption Nothing []) [(AlignDefault, ColWidthDefault), (AlignDefault, ColWidthDefault)] (TableHead ( "" , [] , [] ) [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "a"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "b"]] ] ]) [TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Para [Str "x"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [CodeBlock ( "" , [] , [] ) "code"] ] ]] (TableFoot ( "" , [] , [] ) [] ) ]
Writer (no blank line between the x cell and the code cell):
$ printf -- '...' | cargo run --bin pampa -- -t qmd 2>&1
::: {.list-table}
* - a
- b
* - x
- ```
code
```
:::
Round trip (the x cell is now Plain):
$ printf -- '...' | cargo run --bin pampa -- -t qmd 2>/dev/null | cargo run --bin pampa -- 2>&1
[ Table ( "" , [] , [] ) (Caption Nothing []) [(AlignDefault, ColWidthDefault), (AlignDefault, ColWidthDefault)] (TableHead ( "" , [] , [] ) [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "a"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "b"]] ] ]) [TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [Row ( "" , [] , [] ) [Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "x"]] , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [CodeBlock ( "" , [] , [] ) "code"] ] ]] (TableFoot ( "" , [] , [] ) [] ) ]
The only difference between the two reads:
- Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Para [Str "x"]]
+ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "x"]]
Related: #1098 introduced the looseness rule that exposes this. #1151 fixes a sibling writer round trip from the same change (adjacent lists inside a list item) but only touches write_bulletlist / write_orderedlist and the raw-block separator, not write_list_table, so it does not cover this case. #174 was the same Para to Plain symptom for ordinary bullet lists.
In the wild (quarto-web grid tables with a code-block cell; qmd-syntax-helper convert -r grid-tables turns them into list tables with blank-line-separated cells):
- https://github.com/quarto-dev/quarto-web/blob/781af76ce83db51b4b02ddcb5a871de1b20f2cba/docs/computations/caching.qmd#L17
- https://github.com/quarto-dev/quarto-web/blob/781af76ce83db51b4b02ddcb5a871de1b20f2cba/docs/manuscripts/next-steps.qmd#L12
- https://github.com/quarto-dev/quarto-web/blob/781af76ce83db51b4b02ddcb5a871de1b20f2cba/docs/faq/rmarkdown.qmd#L41
- Ngôn ngữ chính
- Rust
- Star
- 302
- Fork
- 22
- Merge trung bình
- 5 giờ 2 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 quarto-dev/q2
-
`dir: rtl` isn't written to `<html>` in HTML outputCó 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 78/100
quarto-dev/q2#1219 ·
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 75/100
quarto-dev/q2#1188 · 3 bình luận ·
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 73/100
quarto-dev/q2#1179 ·
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 82/100
quarto-dev/q2#1133 ·
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 76/100
quarto-dev/q2#1103 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/q2
Issue tương tự
-
priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
storytold/photocraft#15350 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:davinci
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ubugeeei-prod/vize#13167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ui enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
transit-audio/transit#738 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
hocinehacherouf/liberarr#78 ·
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 68/100
Maintainer thường phản hồi trong vòng 1 ngày