-
Notifications
You must be signed in to change notification settings - Fork 795
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(has-text-content): add generic check has-text-content (#2234)
* feat(has-text-content): add generic check has-text-content * make empty-heading minor
- Loading branch information
Showing
9 changed files
with
27 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { sanitize, subtreeText } from '../../commons/text'; | ||
|
||
function hasTextContentEvaluate(node, options, virtualNode) { | ||
return sanitize(subtreeText(virtualNode)) !== ''; | ||
} | ||
|
||
export default hasTextContentEvaluate; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...hecks/shared/has-visible-text-evaluate.js → ...ks/shared/has-accessible-text-evaluate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { accessibleTextVirtual } from '../../commons/text'; | ||
|
||
function hasVisibleTextEvaluate(node, options, virtualNode) { | ||
function hasAccessibleTextEvaluate(node, options, virtualNode) { | ||
return accessibleTextVirtual(virtualNode).length > 0; | ||
} | ||
|
||
export default hasVisibleTextEvaluate; | ||
export default hasAccessibleTextEvaluate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"id": "has-accessible-text", | ||
"evaluate": "has-accessible-text-evaluate", | ||
"metadata": { | ||
"impact": "minor", | ||
"messages": { | ||
"pass": "Element has text that is visible to screen readers", | ||
"fail": "Element does not have text that is visible to screen readers" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters