JSON-writer diagnostics are dropped ("failed to serialize AST to Pandoc JSON (1 diagnostics)"); a stray `{key=value}` in prose triggers it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Start in crates/quarto-core/src/stage/stages/pandoc_write.rs near line 1125, where json_result.map_err keeps only diags.len(), then trace how the writer's diagnostics in writers/json.rs could be passed through to the output. Reproduce with q2 render s4.qmd --to docx using the {colspan=2} paragraph, and check that the --json-errors output includes a location. Done means the writer's diagnostics are printed with their source location, and a parse-time diagnostic is emitted for the standalone attribute so that HTML and docx agree.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Tested with q2 0.47.0 and pandoc 3.14 (via QUARTO_PANDOC) on Windows 11.
When the pandoc JSON writer reports a problem, the render stops with only a count. In crates/quarto-core/src/stage/stages/pandoc_write.rs (around line 1125), json_result.map_err(|diags| …) keeps diags.len() and drops the diagnostics. So the author never sees the message the writer built, with its location. This affects every format that goes through pandoc: docx, json, native, plain and so on.
A simple way to trigger it is a {key=value} block in the middle of a paragraph, for example after pasting text, or when trying an attribute where q2 doesn't support one. The parser accepts it as a standalone attribute. writers/json.rs treats that as a case that "should not reach" it, and builds the error "Standalone attribute not supported in JSON format".
Repro
Text {colspan=2} here.
q2 render s4.qmd --to docx
Actual:
Error: failed to serialize AST to Pandoc JSON (1 diagnostics)
The one diagnostic isn't printed. --json-errors gives "details":[] and no location. With --to html, the render succeeds and the paragraph is <p>Text here.</p>: the text is dropped without a warning.
Expected:
- The writer's diagnostics are shown, with their source location.
- A standalone attribute that has nothing to attach to gets a diagnostic at parse time, as Q-2-41 does for invalid brace runs like
{ a, b }. Then HTML and docx behave the same, and the text doesn't silently disappear in HTML.
- Lingua principale
- Rust
- Stelle
- 316
- Fork
- 23
- Merge medio
- 11h 49m
- PR unite (30g)
- 245
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/q2
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`Forse già presa @cscheid l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/q2#1419 ·
I maintainer di solito rispondono entro 1 giorno
-
bug testing windows
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/q2#1346 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
quarto-dev/q2#1095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
quarto-dev/q2#1418 ·
I maintainer di solito rispondono entro 1 giorno
-
bug readers-writers windows
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
quarto-dev/q2#1416 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/q2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
BurntSushi/jiff#755 ·
I maintainer di solito rispondono entro 1 giorno
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status lineApertabug help wanted priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sawhorse3d/sawhorse#163 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MartinPTielemans/ilo#4607 ·