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

未关闭 适合新手
#1,929 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
css, html, javascript

调研方向

打开 wicket-user-guide/src/main/asciidoc/js/guide.js 并阅读 followSections():它把每个 TOC 链接拆成一个 span.toc-num 加一个文本节点,并丢弃两者之间的空白。保留文本节点中的空格(例如追加 ' ' + match[2]),然后移除 wicket.css 中 .toc-num 上的 margin-right,这样视觉间隙就不会加倍。构建指南并确认 TOC 看起来没有变化,且某个链接的可访问名称读作 "3. Why should I learn Wicket?"。与 #1904 协调,它编辑了相同的行,应当先落地。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Java
星标
800
派生
423
平均合并
1 天 1 小时
30 天内合并 PR
170

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/wicket 的其他 Issue

查看 apache/wicket 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。