IITAA Rule 30: Longdesc must have valid URI.
Rule Mapping
- Status: Accepted
- Severity: Violation
- Priority: Priority 1
Details
For images that don’t have a presentation role, make sure longdesc points to a legitimate alternative resource (e.g. an .html file).
Markup References
Validation Code
Dependencies
None
Context
img[@longdesc][@role != "presentation"]
Parameters
- valid_longdesc_url_pattern : { type: Regular Expression , value: /.+\.[x]?htm[l]?$/i }
Code
function (ruleContext) {
var passed = this.validateParams.valid_longdesc_url_pattern.value.test(ruleContext.longDesc);
return new ValidationResult(passed, [ruleContext], 'longdesc', '', []);
} // endfunction
>
var passed = this.validateParams.valid_longdesc_url_pattern.value.test(ruleContext.longDesc);
return new ValidationResult(passed, [ruleContext], 'longdesc', '', []);
} // endfunction
>