Skip to content

p-as-heading rule should account for text length #3130

@WilcoFiers

Description

@WilcoFiers

Axe-core's p-as-heading rule is reporting an incorrect issue on the Azure page:
https://azure.microsoft.com/en-us/services/active-directory/external-identities/#customers

This problem can be avoided by checking the length of the possible heading, compared to the length of the supposed paragraph. I would say that if the heading is longer than the paragraph, we pass it. If it's less than twice as long, we set it for review, and only if the suspected fake heading is at least 200% shorter than the paragraph do we allow it to be failed.

The way to do this would be in the p-as-heading-evaluate.js file, to grab textContent of both nodes and compare the length. We should probably make these configurable through a check option as well.

Metadata

Metadata

Assignees

Labels

experimentalfixBug fixesgood first issueFor first-time contributorsprA pr has been created for the issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions