Parser: a stray `{key=value}` in a paragraph is accepted silently (passes --dry-run, dropped in HTML)

オープン
#1,444 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
tooling

調査の方向性

Start by tracing how q2 parses standalone attributes and how q2 render --dry-run reports parse problems; the issue does not name source files or tests. Reproduce with Text {colspan=2} here. and compare dry-run with HTML and docx output. Done means dry-run reports the stray attribute with its location, and rendering no longer silently drops the text.

索引モデルが issue の本文から書いたものです。

説明

Tested with q2 0.48.0 on Windows 11. Split from #1322, which now covers only the JSON writer's hidden diagnostics.

A {key=value} block in the middle of a paragraph is accepted as a standalone attribute with nothing to attach to. Nothing reports it:

  • q2 render --dry-run finds no problems.
  • --to html succeeds and drops the text without a warning.
  • --to docx (and other formats that go through pandoc) fails in the JSON writer with "Standalone attribute not supported in JSON format" (see #1322).

This happens easily after pasting text, or when trying an attribute somewhere q2 doesn't support one (for example a list-table cell attribute outside a list table).

Repro

Text {colspan=2} here.
$ q2 render s4.qmd --dry-run
Checked 1 file — no problems found

$ q2 render s4.qmd --to html
<p>Text  here.</p>

Proposal: report a standalone attribute that has nothing to attach to at parse time, with its location:

  • An error, not a warning. It already stops every format that goes through pandoc, so making it an error everywhere means HTML and docx behave the same. HTML stops losing text without saying so, and --dry-run catches what a docx render would fail on.
  • A new Q-code, with a hint that attributes go directly after a span ([text]{key=value}), a heading, or a div/code fence.

If a warning that keeps the text as literal text fits q2 better, that would also solve it for us. What matters is that --dry-run reports it.

主要言語
Rust
スター
321
フォーク
23
平均マージ
11時間 39分
マージ済み PR(30日)
251

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。