a11y: Adjacent website links for navbar logo and navbar title go to the same URL

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

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

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

評価

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

調査の方向性

まず、logo、logo-alt、logo-hrefを処理するnavbarのレンダリングコードを見つけます。issueにはファイル名もテストも指定されていません。navbarのタイトルとロゴを含む新しいウェブサイトで再現し、レンダリングされたnavbarのリンクを確認します。logo-hrefが未設定の場合はロゴとタイトルが1つのリンクを共有し、設定されている場合は別々のリンクのままであれば完了です。

索引モデルが 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
Problem

When a website has both a title and logo in the navbar and logo-href is unset, two sequential links are created to the same URL:

<div class="navbar-brand-container mx-auto">
    <a href="http://localhost:6891/" class="navbar-brand navbar-brand-logo" data-original-href="http://localhost:6891/index.html">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo light-content" style="">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo dark-content" style="">
    </a>
    <a class="navbar-brand" href="http://localhost:6891/" data-original-href="http://localhost:6891/index.html" style="">
    <span class="navbar-title">repro</span>
    </a>
</div>
Why is this an issue

Strictly speaking I don't think the WCAG specify that this is a problem. It is instead described as a "technique"

Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are not required to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See About WCAG Techniques.

Technique H2: Combining adjacent image and text links for the same resource

It is however flagged as a warning by certain accessibility checking tools such as Wave by WebAIM

Why It Matters

When adjacent links go to the same location (such as a linked product image and an adjacent linked product name that go to the same product page) this results in additional navigation and repetition for keyboard and screen reader users.

Suggestion

I think this is straightforward to fix. If logo-href is unset it should be structured into a single <a> block and if logo-href is set only then it should split into two <a> blocks.

Steps to reproduce

Steps to reproduce:

  1. quarto create a new website
  2. in _quarto.yml add under navbar:, e.g.
logo: https://quarto.org/assets/images/favicon.png
logo-alt: "link to homepage"
Actual behavior

Sequential <a> tags with the same href:

<div class="navbar-brand-container mx-auto">
    <a href="http://localhost:6891/" class="navbar-brand navbar-brand-logo" data-original-href="http://localhost:6891/index.html">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo light-content" style="">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo dark-content" style="">
    </a>
    <a class="navbar-brand" href="http://localhost:6891/" data-original-href="http://localhost:6891/index.html" style="">
    <span class="navbar-title">repro</span>
    </a>
</div>
Expected behavior

If logo-href is unset, both the logo and title should be contained in a single <a> block (this does affect the CSS, however)

<div class="navbar-brand-container mx-auto">
    <a href="http://localhost:6891/" class="navbar-brand navbar-brand-logo" data-original-href="http://localhost:6891/index.html">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo light-content" style="">
    <img src="https://quarto.org/assets/images/favicon.png" alt="link to homepage" class="navbar-logo dark-content" style="">
    <span class="navbar-title">repro</span>
    </a>
</div>
Your environment
  • Quarto 1.12.3 installed from the .deb package
  • OS: Arch Linux
  • Browser: Firefox
Quarto check output
Quarto 1.12.3
[✓] Checking environment information...
      Quarto cache location: /home/sera/.cache/quarto
      Project: none found (single-file mode)
[✓] 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 versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.12.3
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chrome Headless Shell: (not installed)
      VeraPDF: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: undefined

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /home/sera/.local/bin/chromium-browser
      Source: PATH

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........OK
      Version: 4.6.2
      Path: /usr/lib64/R
      LibPaths:
        - /home/sera/.R
        - /usr/lib/R/library
      knitr: 1.52
      rmarkdown: 2.32

[✓] Checking Knitr engine render......OK

[✓] Checking Python 3 installation....OK
      Version: 3.14.10
      Path: /usr/bin/python3
      Jupyter: 5.9.1
      Kernels: ir, julia-1.13, python3, sagemath

(/) Checking Jupyter engine render....[IPKernelApp] WARNING | Kernel is running over TCP without encryption. All communication (including code and outputs) is sent in plain text and is susceptible to eavesdropping. Use IPC transport or launch with kernel manager-provisioned CurveZMQ keys to enable transport encryption.
[✓] Checking Jupyter engine render....OK

[✓] Checking Julia installation...
主要言語
JavaScript
スター
6.2k
フォーク
496
平均マージ
15時間 47分
マージ済み PR(30日)
87

環境構築

はじめの一歩

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

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

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

似ている issue

JavaScript の issue をもっと見る

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

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