A callout with an id loses its number in the default title

クローズ 初心者向け
#1,020 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #1050 @cscheid による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

crates/quarto-core/src/transforms/callout_resolve.rsの240〜262行あたりから始めます。issueでは、デフォルトタイトルが作成され、ref_typeを利用できる箇所とされています。提供されたindex.qmdをq2 render index.qmd --to htmlでレンダリングし、参照テキストと併せてcalloutのタイトルを確認します。デフォルトタイトルに同じ相互参照の接頭辞と番号が含まれ、Quarto 1と一致すれば完了です。

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

説明

Bug description

A callout with an id such as nte-x and no title gets the title "Note 1" in Quarto 1.
q2 gives it the title "Note".
The reference @nte-x reads "Note 1" in both engines, so the page names a number that the callout does not show.

The default title is built from the callout type alone.
The transform knows that the callout is a cross-reference target (ref_type), but it does not add the number:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/quarto-core/src/transforms/callout_resolve.rs#L240-L262

The comment in that block expects such a callout to carry a cross-reference prefix in its title, so the number seems meant to be there.

Steps to reproduce

index.qmd:

---
format: html
---

::: {#nte-x .callout-note}
Body.
:::

See @nte-x.

Run q2 and Quarto 1 on it:

q2 render index.qmd --to html
quarto render index.qmd --to html
Actual behavior

q2 gives the callout the title "Note", while the link text has the number:

<div class="callout-title-container flex-fill">
Note
</div>
...
<p>See <a href="#nte-x" class="quarto-xref">Note 1</a>.</p>

Quarto 1.12.0 writes "Note 1" in both places.

Expected behavior

The title reads "Note 1", as in Quarto 1.
The default title should use the same prefix and number as the cross-reference.

Your environment
  • q2: Q2 (quarto 2) 0.40.0-nightly.20261101 (nightly built from a2a1cb9).
  • Quarto 1 for comparison: 1.12.0 (pre-release).
  • OS: macOS 27.2 (arm64).
  • Terminal, no IDE.
主要言語
Rust
スター
293
フォーク
20
平均マージ
5時間 38分
マージ済み PR(30日)
199

環境構築

はじめの一歩

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

quarto-dev/q2 のほかの issue

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

似ている issue

Rust の issue をもっと見る

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

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