p-as-heading rule should account for text length #3130
Labels
experimental
fix
Bug fixes
good first issue
For first-time contributors
pr
A pr has been created for the issue
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.The text was updated successfully, but these errors were encountered: