Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WilcoFiers opened this issue Aug 23, 2021 · 6 comments
Closed

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

WilcoFiers opened this issue Aug 23, 2021 · 6 comments
Assignees
Labels
experimental fix Bug fixes good first issue For first-time contributors pr A pr has been created for the issue

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Aug 23, 2021

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.

@WilcoFiers WilcoFiers added fix Bug fixes experimental good first issue For first-time contributors labels Aug 23, 2021
@WilcoFiers
Copy link
Contributor Author

Not the easiest "good first issue", but doable for anyone comfortable with JS, and willing to dig a little.

@Zidious Zidious self-assigned this Sep 1, 2021
@ilyaryabchinski
Copy link

May I take work on this one?

@Zidious
Copy link
Contributor

Zidious commented Sep 2, 2021

May I take work on this one?

Sorry! I am currently working on this ticket.

@ilyaryabchinski
Copy link

No worries!

@dan-tripp
Copy link
Contributor

I was looking at this issue too. I'm happy to leave it to @Zidious - but @WilcoFiers , I don't suppose you have any more "good first issues" that I could work on? I don't see any more which don't have an assignee or a PR.

@straker straker added the pr A pr has been created for the issue label Oct 14, 2021
@padmavemulapati
Copy link

Validated with the latest axe-core develop branch code base,
as per the fix validations went like:
If the heading is longer than the paragraph, it will be pass .
If it's less than twice as long, it will go for review,
and only if the suspected heading is at least 200% shorter than the paragraph it will fail.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental fix Bug fixes good first issue For first-time contributors pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

7 participants