JSON-writer diagnostics are dropped ("failed to serialize AST to Pandoc JSON (1 diagnostics)"); a stray `{key=value}` in prose triggers it
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 316
- フォーク
- 23
- 平均マージ
- 11時間 49分
- マージ済み PR(30日)
- 245
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`対応中かも @cscheid が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1419 ·
メンテナーはふだん 1 日以内に返信
-
bug testing windows
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1346 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/q2#1095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
quarto-dev/q2#1418 ·
メンテナーはふだん 1 日以内に返信
-
bug readers-writers windows
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
quarto-dev/q2#1416 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
BurntSushi/jiff#755 ·
メンテナーはふだん 1 日以内に返信
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status lineオープンbug help wanted priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sawhorse3d/sawhorse#163 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
MartinPTielemans/ilo#4607 ·