docx: chapter cross-reference numbers don't restart per chapter (crossref: chapters: true)

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

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

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

評価

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

調査の方向性

The bug is in how docx output numbers captioned figures with chapter cross-references (crossref: chapters: true). Start by finding where the chapter prefix and per-figure counter are computed in the Rust crossref or docx writer code, and check why the counter is not reset at each level-1 heading. Run the repro from the issue (two level-1 headings, one figure each) with --to docx and confirm the second figure reads "Figure 2.1".

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

説明

With crossref: chapters: true, docx output numbers figures across chapters instead of restarting the count in each chapter: the first figure of chapter 2 becomes "Figure 2.2". Quarto 1 (1.11.9) gives "Figure 2.1" for the same document.

Repro (q2 0.47.0, pandoc 3.14 via QUARTO_PANDOC, Windows):

---
crossref:
  chapters: true
---

# One

![First](img.svg){#fig-a}

# Two

![Second](img.svg){#fig-b}

See @fig-a and @fig-b.

q2 render xref.qmd --to docx

Actual: captions "Figure 1.1: First" and "Figure 2.2: Second"; the references read "Figure 1.1" and "Figure 2.2".

Expected: "Figure 2.1" for the second figure, as in Quarto 1.

The chapter prefix is right, but the counter after it isn't reset at each level-1 heading.

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

環境構築

はじめの一歩

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

quarto-dev/q2 のほかの issue

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

似ている issue

Rust の issue をもっと見る

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

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