Skip to content

Commit 00a5c40

Browse files
committed
fix: normalize role/aria-hidden values — trim + lowercase (Copilot review)
1 parent fbf4c1b commit 00a5c40

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/rules/template-no-empty-headings.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ function isAriaHiddenTruthy(attr) {
2828
return true;
2929
}
3030
if (value.type === 'GlimmerTextNode') {
31-
const chars = value.chars.toLowerCase();
31+
// Normalize like other aria-* value checks: trim incidental whitespace
32+
// and compare case-insensitively. `aria-hidden=" true "` is semantically
33+
// "true" per the trim step used elsewhere in this rule family.
34+
const chars = value.chars.trim().toLowerCase();
3235
// Empty string is exempted (lean toward fewer false positives).
3336
return chars === '' || chars === 'true';
3437
}

0 commit comments

Comments
 (0)