pampa - Unsupported definition lists in quarto-web change AST after a QMD round trip
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 54/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 278
- Forks
- 19
- Merge medio
- 20 h 23 min
- PR fusionados (30 d)
- 164
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/q2
-
Dificultad 3/5 1-2 días Aptitud para principiantes 63/100
quarto-dev/q2#904 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 48/100
quarto-dev/q2#900 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
quarto-dev/q2#896 ·
Los mantenedores suelen responder en 1 día
-
"I want :emoji: to work"Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
quarto-dev/q2#893 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
quarto-dev/q2#892 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/q2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
farion1231/cc-switch#8829 ·
Los mantenedores suelen responder en 1 día
-
bug ci good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
longbridge/gpui-kit#3677 ·
Los mantenedores suelen responder en 1 día
-
E-pr-welcome
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
seanmonstar/reqwest#3121 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
ilya-zlobintsev/LACT#1235 ·
Los mantenedores suelen responder en 1 día