Markup is valid and well-formed
Why it matters
Invalid HTML — duplicate IDs, improperly nested elements, unclosed tags — causes screen readers to parse the DOM incorrectly or skip content entirely. WCAG 2.2 SC 4.1.1 (Parsing) is a Level A requirement. Duplicate id values break aria-labelledby, aria-describedby, and for associations — the very attributes that connect form labels to inputs and error messages to fields. A heading nested inside a <button> confuses the accessibility tree in ways that vary unpredictably across screen readers.
Severity rationale
Low because markup errors produce inconsistent rather than universal failures — different browsers and AT combinations are affected differently — but duplicate IDs break ARIA relationships globally throughout the page, violating WCAG 2.2 SC 4.1.1 at Level A.
Remediation
Run automated HTML validation as part of your CI pipeline to catch duplicate IDs and nesting errors before they reach production.
# Install htmlhint as a dev dependency
npm install --save-dev htmlhint
# Add to package.json scripts
"lint:html": "htmlhint 'src/**/*.html' 'public/**/*.html'"
# Or use Nu Validator for rendered output in CI
npx @nicolo-ribaudo/nuhtml-check http://localhost:3000
For React/JSX specifically, duplicate id values are the most common violation. Search the codebase for hardcoded id= strings that appear more than once — every duplicate breaks any ARIA attribute referencing that ID. Also check for <div> or <p> inside <button> and <p> inside <p>, which are invalid nesting patterns that corrupt the accessibility tree.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Accessibility WCAG Compliance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 4.1.1 — Parsing
- section-508:2018-refresh · 501.1 — Scope
Taxons
History
- 2026-04-18·v1.0.0·Initial import from accessibility-wcag·automated