HomeGitHub testing plugin to inspect alternative text in images with the 5 rule

Technology is

GitHub testing plugin to inspect alternative text in images with the 5 rule

Concept diagram that examines images extracted from web pages with insect glasses and lists the points.
AI generated image

A plugin has been released to check the alternative text of images, not only for the absence of attributes, but also for the quality of speech.5 has a default rule that detects ambiguous words, file names, duplicates, implicit phrases, etc., and passes the clue to existing accessibility tests.

Extract the image and reduce the img element to test.

The alternative text checking plugin for the Accessibility Scanner released by GitHub, the Alt-Text Plugin, checks the wording attached to the image on a web page. The image is obtained using the Playwright accessibility thread, leaving only the img element of HTML to be examined from the elements recognized as images.

Different elements or non-visual images with image roles are removed from the object at this stage.Decorative images with alt="" are also excluded, so it is not a configuration that treats empty alternative text as being absent.

5 rules determine the absence and quality of speech.

The extracted images are subject to the rules of 5 by default. Subjects are the absence of alt attributes, ambiguous phrases, phrases using image file names as they are, duplicates in adjacent images, and implicit phrases indicating spelling. In the judgment of ambiguous phrases, the phrases are matched with the phrases of the large and small letters, the emptiness, and the reading points before and after.

The overlapping rule points out when the 2 or more images adjacent to the display page have the same alternative text after normalization.The accessibility scanner’s built-in axe scan detects the absence of alt attributes and only the empty values, so that the remaining 4 rule in the plugin solves the verbal problem.

Any model judgment is based on the content of the image.

For statements that cannot be judged by standard words or string consistency alone, any model judgment rule can be used. This rule matches the image itself with the alternative text and points out the inaccuracies or deficiencies of the description, and the inclusion of SEO keywords.

Model judgment is deactivated by default. Activation requires a GitHub Models token, and the setting conditions are different from the default rules of 5.

Add to the scanner and link the point to the issue.

The plug-in is published as a npm package.When you specify a package name in Accessibility Scanner’s scans input, the scanner will install it when the Find subaction is performed, so you don’t have to copy the source of the plug-in to the repository being tested.

Accessibility Scanner converts that note into GitHub’s Issue, so that it can track any alternative text problems for each image.