Table of contents highlight stops working when a heading id contains a percent sign
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
src/resources/formats/html/quarto.js の DOMContentLoaded ハンドラー、特に 145~152 行目の decodeURI 呼び出しから確認してください。id="bad%zz" を使用する提供された Quarto ドキュメントで再現し、スクロールによって目次が更新されることと、不正なターゲットが未捕捉の URIError をスローしなくなることを確認してください。報告では、デコードに失敗した場合は未加工のターゲットにフォールバックすることが提案されています。
索引モデルが issue の本文から書いたものです。
説明
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
quarto.js passes each table of contents data-scroll-target through decodeURI.
A heading id with a % that does not start a valid escape, such as {id="bad%zz"}, makes decodeURI throw URIError: URI malformed.
The error is not caught, so the rest of that DOMContentLoaded handler does not run.
The visible effect: the table of contents no longer follows the scroll position.
This is an edge case.
Only an explicit id="..." attribute triggers it.
Automatic ids drop the %, and Pandoc does not read {#bad%zz} as an attribute, so both are safe.
A valid escape such as id="bad%20ok" is also safe.
At render time, Quarto already warns: WARN: Invalid URI '#bad%zz' in attribute 'href' of element 'A'.
Steps to reproduce
---
title: "Repro"
format:
html:
toc: true
---
## Fine
Text.
## Bad target {id="bad%zz"}
Text.
## Last
Text.
- Run
quarto renderand serve the output over HTTP. - Open the page and scroll down.
Actual behavior
The console shows Uncaught URIError: URI malformed from quarto.js.
After scrolling, the table of contents still highlights "Fine".
Expected behavior
The table of contents highlights the section in view, as it does when the id has no %.
A target that cannot be decoded could fall back to the raw value.
Your environment
- IDE: none, command line.
- OS: macOS 27.2.
- Browser: Brave, Chromium 156.0.8078.80.
Quarto check output
Reproduced with a development build of main at 089ba530b.
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 089ba530b3ed4ec156a355d41b6b7de2db3e44ea
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking tools....................OK
TinyTeX: v2026.07
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
- 主要言語
- JavaScript
- スター
- 6.1k
- フォーク
- 478
- 平均マージ
- 17時間 53分
- マージ済み PR(30日)
- 135
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
accessibility bug embed
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
quarto-dev/quarto-cli#15306 ·
メンテナーはふだん 1 日以内に返信
-
bootstrap bug themes
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
quarto-dev/quarto-cli#15304 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug code-blocks html themes
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/quarto-cli#15303 ·
メンテナーはふだん 1 日以内に返信
-
accessibility brand bug dark-mode
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
quarto-dev/quarto-cli#15301 ·
メンテナーはふだん 1 日以内に返信
-
bootstrap bug html tables
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/quarto-cli#15300 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
OWASP/CheatSheetSeries#2905 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ComposioHQ/composio#5249 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
zilliztech/memsearch#838 ·
メンテナーはふだん 1 日以内に返信
-
[DOCS] Nine one-colon directives hide code examples and notes in the reference docs (e.g. CustomJS)オープンTRIAGE
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
cdx-audit output written to a pipe is cut off at 64 KiB再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug mode:cli
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信