qmd-syntax-helper: Pandoc-based rules lose reference links and footnotes that depend on the rest of the document
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 77/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- markdown, rust
- 領域
- documentation, tooling
調査の方向性
Issueでは、移行ガイドでの警告と、qmd-syntax-helperの出力に含まれるエスケープされた角括弧の並びに対する任意の警告が提案されています。ファイルやテストは指定されていません。まず移行ガイドとhelperの出力処理を探し、次にそのルールが変換結果をどのように報告するかを確認してください。ガイドで、影響を受けるブロック内の参照と脚注は変換前に変換する必要があると説明され、出力で確認が必要なエスケープされた角括弧を警告できるようになれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Some qmd-syntax-helper rules (definition-lists, and grid-tables when it produces list tables) pass the construct they convert through Pandoc and write it back from Pandoc's AST. Pandoc only sees the construct itself, not the rest of the document. Markup inside it that depends on something elsewhere in the document therefore cannot be resolved: reference-style links and their [label]: url definitions, and footnote references with their [^n]: ... definitions. That markup is written back as escaped literal text (\[the manual\]\[docs\], \[\^1\]), and the link or footnote is silently lost.
Running the rules in the other order does not help. Before conversion, q2 reads a Pandoc definition list as literal text, so the reference-links rule cannot see uses inside it. It then treats their definitions as unused and removes them. Either way, the URL for a reference link inside a definition list disappears from the document. It can only be recovered from version control. I don't think this can be prevented in general: the construct has to be converted before its contents are visible to q2, and converting it is what strips the context. But the migration guide should warn about it. The helper could also flag its own output when it contains escaped \]\[ or \[\^ sequences, so these cases get a manual look.
Example
Some prose with a [working link][docs].
Term
: A definition that cites [the manual][docs]
and has a footnote[^1].
[docs]: https://example.com/docs
[^1]: The footnote text.
Pandoc renders both links and the footnote. After qmd-syntax-helper convert -r definition-lists -i:
Some prose with a [working link][docs].
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[docs]: https://example.com/docs
[^1]: The footnote text.
and then after -r reference-links:
Some prose with a [working link](https://example.com/docs).
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[^1]: The footnote text.
The link inside the definition is now literal text, and its URL is gone. The footnote reference is literal and its definition is orphaned. Running reference-links first and definition-lists second ends in the same state: the use inside the definition list is not seen, so [docs]: is removed in the first step.
A suggested sentence for the migration guide: before converting definition lists or grid tables, convert any reference-style links and footnotes inside them to inline form by hand ([text](url), ^[note]). Afterwards, review the converted blocks for escaped brackets.
qmd-syntax-helper 0.1.0, pandoc 3.13.
- 主要言語
- Rust
- スター
- 321
- フォーク
- 23
- 平均マージ
- 11時間 39分
- マージ済み PR(30日)
- 251
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
quarto-dev/q2#1446 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/q2#1095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
quarto-dev/q2#1448 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
quarto-dev/q2#1447 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
quarto-dev/q2#1444 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ProvableHQ/snarkOS#4817 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
facebookexperimental/reverie#193 ·
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pbakaus/impeccable#1748 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
farion1231/cc-switch#10196 ·
メンテナーはふだん 1 日以内に返信