A list-table cell holding a paragraph is written tight and re-reads as plain
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 302
- Forks
- 22
- Avg merge
- 5h 2m
- Merged PRs (30d)
- 213
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/q2
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quarto-dev/q2#1219 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
quarto-dev/q2#1188 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
quarto-dev/q2#1179 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
quarto-dev/q2#1133 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
quarto-dev/q2#1103 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
storytold/photocraft#15350 ·
Maintainers usually reply within 1 day
-
area:davinci
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ubugeeei-prod/vize#13167 ·
Maintainers usually reply within 1 day
-
area:ui enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
transit-audio/transit#738 ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
hocinehacherouf/liberarr#78 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day