accessibility-developer-tools
accessibility-developer-tools copied to clipboard
AX_TEXT_04: Purpose of pagination links
trafficstars
AX_TEXT_04: The purpose of each link should be clear from the link text.
If you have pagination on the page, should links with the text "Page 1", "Page 2", etc be enough?
<nav>
<ul>
<li><a href="/?p=3" rel="prev"><span aria-label="Previous page">[«]</span></a></li>
<li><a href="/"><span>Page</span> 1</a></li>
<li><a href="/?p=2"><span>Page</span> 2</a></li>
<li><a href="/?p=3" rel="prev"><span>Page</span> 3</a></li>
<li><strong><span>Page</span> 4</strong></li>
<li><a href="/?p=5" rel="next"><span>Page</span> 5</a></li>
<li><a href="/?p=6"><span>Page</span> 6</a></li>
<li><a href="/?p=7"><span>Page</span> 7</a></li>
<li><a href="/?p=8"><span>Page</span> 8</a></li>
<li><a href="/?p=9"><span>Page</span> 9</a></li>
<li><a href="/?p=5" rel="next"><span aria-label="Next page">[»]</span></a></li>
</ul>
</nav>
Seems to me like "Page X" should be clear enough. We're failing because "page" is one our "stop words," leaving only numeric content after it's stripped away which isn't descriptive enough
https://github.com/GoogleChrome/accessibility-developer-tools/blob/master/src/audits/LinkWithUnclearPurpose.js#L55-L58
// Remove punctuation from phrase, then strip out all stopwords. Fail if remaining text is
// all whitespace.
var stopwords = config['stopwords'] ||
['click', 'tap', 'go', 'here', 'learn', 'more', 'this', 'page', 'link', 'about'];
Wondering if we should make a special exception: I could see "This page" being unclear, but "Page 54" being just fine.