Skip to main content

img_missing_alt

Function img_missing_alt 

Source
pub fn img_missing_alt(tag: &str) -> bool
Expand description

Whether an <img> tag lacks a text alternative (WCAG 1.1.1).

Exported so the host crate’s other alt-text checks agree with check_page on what counts as missing, rather than keeping their own copy of the rule. Additive. Returns true if an <img> tag has no text alternative: no alt attribute at all, or an empty one on an image that is not marked decorative (see WCAG 1.1.1).

Expects the tag with ASCII-lowercased attribute names, from <img to its closing > (see find_tag_end).