The current entry of the table of contents has no `aria-current`

オープン 初心者向け
#15,438 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

リンク先の行にある src/resources/formats/html/quarto.js のスクロール追跡コードから始め、目次のレンダリングとそのテストを調べてください。2つのセクションがある Quarto ドキュメントで報告された動作を再現し、スクロール時にアクティブな項目とともに aria-current="location" が更新されることを確認してください。現在の項目に属性があり、他の項目にはない状態になれば完了です。

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

説明

accessibility bug
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

In the table of contents, Quarto marks the entry for the section in view with class="active" only.
A screen reader cannot tell which entry is current.
The class gives this information to sighted users only, which fails WCAG 4.1.2 Name, Role, Value (Level A).

The scroll tracking only adds and removes the class:

The navbar already sets aria-current="page", and #15190 reports the same gap for the sidebar link of the current page.
The table of contents needs the same, for example aria-current="location" on the active entry.

Steps to reproduce
---
title: TOC
format:
  html:
    toc: true
---

## One

Text.

## Two

Text.

In the rendered page, read the attributes of the entries:

[...document.querySelectorAll("#TOC .nav-link")].map((a) => [a.className, a.getAttribute("aria-current")]);
Actual behavior
[["nav-link active", null], ["nav-link", null]]
Expected behavior

The active entry has aria-current="location", and the other entries have no aria-current.
The attribute follows the active class when the reader scrolls.

Your environment
  • Quarto: 99.9.9 (development build, commit 83432c0).
  • Browser: Chromium (Playwright).
  • OS: macOS 27.2.1.
Quarto check output
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.13.0: OK
      Dart Sass version 1.107.1: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 83432c028f6c07167c23f948da7067b37fe8a18b
主要言語
JavaScript
スター
6.2k
フォーク
492
平均マージ
13時間 51分
マージ済み PR(30日)
82

環境構築

はじめの一歩

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

quarto-dev/quarto-cli のほかの issue

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

似ている issue

JavaScript の issue をもっと見る

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

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