Type of policy: XPath
What it is used for: A common accessibility no-no is to create a link where the link text is the address for the link. Screen readers will often read these links letter by letter. For instance, a link embedded as http://google.com may be read as h-t-t-p-:-/-/-g-o-o-g-l-e-.-c-o-m. This custom check will identify cases where "http" or "www" are a part of the link's text.
How to set it up:
- Use XPath
- Set policy to “Flag pages that contain the XPath"
- Use the following:
//a[@href and @href !="" and normalize-space(text()) !="" and (@href=text() or contains(text(),"http") or contains(text(),"www."))]
For information on how to create Custom Checks, please see this article.