pampa - Unsupported definition lists in quarto-web change AST after a QMD round trip
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
- 54/100
Hướng nghiên cứu
Start by tracing the Q-2-54 diagnostic and the QMD writer behavior described in the issue; the payload does not name source or test files. Reproduce the supplied typst-show.typ example with pampa, then check how changing Q-2-54 from a warning to an error affects parsing and diagnostics. Done means unsupported definition lists are rejected rather than accepted with a changed AST after writing and reparsing.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This surfaced while round-tripping existing quarto-web documents through q2r and pampa, including appendices.qmd, notebook-embed.qmd, and journals/templates.qmd. These documents use Pandoc-style definition lists. Pampa warns with Q-2-54 but accepts each definition as a paragraph containing its source text in a single literal Str. Writing and reparsing the accepted document changes that AST.
The writer escapes the leading colon, so the next parse treats the definition as ordinary paragraph text with separate words and spaces. Reparsing the emitted QMD produces no Q-2-54 warning, even though the definition has not been migrated to a supported definition-list representation. Definitions containing inline Markdown also lose that formatting during the initial fallback: in the excerpt below, the backticks around typst-template.typ become literal text, which the writer subsequently escapes. All three full documents reproduce the AST change and emit no Q-2-54 diagnostics when their written QMD is parsed again. The initial parse still emits the warning.
Getting the escaping correct seems a bit fraught so one possible option is to make Q-2-54 an error rather than a warning. That would reject these unsupported definition lists instead of accepting a literal-text fallback whose interpretation changes across the round trip. The diagnostic already identifies the supported ::: {.definition-list} form and the qmd-syntax-helper convert -r definition-lists migration command.
The following is the actual typst-show.typ entry from journals/templates.qmd, isolated from the rest of the document. It reproduces both the AST change and the escaping of literal backticks, without nested lists or character references.
Verified with pampa at d3ed54fe4dfc87750d7593ba9b40f974b725752f. Warning's location and hints are abbreviated with ... and Cargo status lines and ANSI color escapes are omitted.
$ printf -- 'typst-show.typ\n\n: A show rule for the entire document that captures document metadata and passes it to the function defined in `typst-template.typ`.\n'
typst-show.typ
: A show rule for the entire document that captures document metadata and passes it to the function defined in `typst-template.typ`.
$ printf -- 'typst-show.typ\n\n: A show rule for the entire document that captures document metadata and passes it to the function defined in `typst-template.typ`.\n' | cargo run --bin pampa -- 2>&1
Warning: [Q-2-54] Pandoc definition lists are not supported
...
[ Para [Str "typst-show.typ"], Para [Str ": A show rule for the entire document that captures document metadata and passes it to the function defined in `typst-template.typ`."] ]
$ printf -- 'typst-show.typ\n\n: A show rule for the entire document that captures document metadata and passes it to the function defined in `typst-template.typ`.\n' | cargo run --bin pampa -- -t qmd 2>&1
Warning: [Q-2-54] Pandoc definition lists are not supported
...
typst-show.typ
\: A show rule for the entire document that captures document metadata and passes it to the function defined in \`typst-template.typ\`.
The warning above comes from parsing the original input before writing QMD. Reading the emitted QMD separately produces the changed AST without a warning:
$ printf -- 'typst-show.typ\n\n\\: A show rule for the entire document that captures document metadata and passes it to the function defined in \\`typst-template.typ\\`.\n' | cargo run --bin pampa -- 2>&1
[ Para [Str "typst-show.typ"], Para [Str ":", Space, Str "A", Space, Str "show", Space, Str "rule", Space, Str "for", Space, Str "the", Space, Str "entire", Space, Str "document", Space, Str "that", Space, Str "captures", Space, Str "document", Space, Str "metadata", Space, Str "and", Space, Str "passes", Space, Str "it", Space, Str "to", Space, Str "the", Space, Str "function", Space, Str "defined", Space, Str "in", Space, Str "`typst-template.typ`."] ]
Two additional probes exposed related writer behavior, but were not the original quarto-web failures:
- A definition body containing
: - first\n - secondinitially becomes literal paragraphs, but the continuation reparses as a bullet list after writing. Rejecting Q-2-54 would also avoid this fallback path.   - itemparses without warnings asPara [Str " - item"], then writes as- itemand reparses as a bullet list. This character-reference case is independent of definition lists and would remain if Q-2-54 became an error but is also unlikely / self-inflicted.
- Ngôn ngữ chính
- Rust
- Star
- 283
- Fork
- 20
- Merge trung bình
- 21 giờ 39 phút
- Pull request đã merge (30 ngày)
- 157
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
-
QuartoHub: have the Document name before the filename in the browser tabCó thể đã có người làm @cscheid đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
quarto-dev/q2#930 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Split hub-client into componentsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
quarto-dev/q2#918 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 63/100
quarto-dev/q2#904 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
quarto-dev/q2#900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quarto-hub
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
quarto-dev/q2#896 · 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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dsx-ai-factory/infra-controller#8341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage:deciding
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
open-telemetry/otel-arrow#4540 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
component:benchmark
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
agentic-os-org/ANOLISA#9177 ·
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 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày