Table of contents entries in the reference guide have no space between number and title for screen readers

Open Beginner friendly
#1,929 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
css, html, javascript

Research direction

Open wicket-user-guide/src/main/asciidoc/js/guide.js and read followSections(): it splits each TOC link into a span.toc-num plus a text node and drops the whitespace between them. Keep the space in the text node (e.g. append ' ' + match[2]), then remove the margin-right on .toc-num in wicket.css so the visual gap does not double. Build the guide and confirm the TOC looks unchanged and a link's accessible name reads "3. Why should I learn Wicket?". Coordinate with #1904, which edits the same lines and should land first.

Written by the indexing model from the issue text.

Description

The entries in the reference guide's table of contents have no space between the section number and the title in their text. Screen readers announce them as, for example, "3.Why should I learn Wicket?" and "13.4.Pageable repeaters".

The cause is followSections() in wicket-user-guide/src/main/asciidoc/js/guide.js. It splits each TOC link into a span.toc-num holding the number and a text node holding the title, and drops the whitespace in between. The visual gap comes from margin-right on .toc-num in wicket.css, so on screen it looks fine, but the link's text content and accessible name have no space. This was introduced in #1845.

The same text ends up in other names built from the link. In #1904 the disclosure buttons are labelled "Sections for 3.Why should I learn Wicket?".

Fix: keep the space in the text when the link is split up. One way is to append ' ' + match[2] instead of match[2] and drop the margin-right from .toc-num. Then check that the TOC still looks the same and that the accessible names read "3. Why should I learn Wicket?".

This touches the same lines in guide.js as #1904, so it should wait until #1904 is merged.

Dominant language
Java
Stars
800
Forks
423
Avg merge
1d 1h
Merged PRs (30d)
170

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/wicket

All issues in apache/wicket

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.