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

Check for no <title> and empty <title> #155

Merged

Conversation

alvaromontoro
Copy link
Contributor

@alvaromontoro alvaromontoro commented Dec 16, 2021

Description

  • Add detection for missing or empty title (missing uses has which is experimental, note added as code comment)
  • Update code and features
  • Update demo page (leave title empty)
  • Add tests for new feature
  • Build and minify

Why is this important?

A missing or empty title would be an accessibility issue because it makes it more difficult for some users to orient themselves and navigate through the pages.

Resolves #153.

Covered test cases

New test cases added to check for empty page title.

Did you test on all major browsers?

  • Chrome
  • Firefox
  • Edge
  • Safari

Other details

N/A


T&Cs

  • I confirm I have read and understand the contributing guidelines
  • I understand the work in this pull request will not be released straight away and will appear in a future release (if approved)
  • I confirm the work in this pull request is true and valid to the best of my knowledge
  • I have updated the README, features.md and codes.md files where applicable

- Add detection for missing or empty title (missing uses has which is experimental, note added as code comment)
- Update code and features
- Update demo page (leave title empty)
- Add tests for new feature
- Build and minify
@jackdomleo7 jackdomleo7 changed the title add check for page title Check for no <title> and empty <title> Dec 21, 2021
Copy link
Owner

@jackdomleo7 jackdomleo7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @alvaromontoro! I was questioning whether this would interfere with <title> that can often appear inside <svg> but it doesn't because you're targeting the <head> so that's good 👌

@jackdomleo7 jackdomleo7 added the a11y feature New feature or request for an a11y check label Dec 21, 2021
@jackdomleo7 jackdomleo7 merged commit 5b8b126 into jackdomleo7:master Dec 21, 2021
@alvaromontoro
Copy link
Contributor Author

alvaromontoro commented Dec 21, 2021

I was questioning whether this would interfere with <title> that can often appear inside <svg> but it doesn't because you're targeting the <head> so that's good 👌

@jackdomleo7 an empty <title> in an SVG would most likely be an accessibility violation too. But I think it would be trickier as the SVG in itself could be pointing to an external element for the title/description. And that part may make it tricky.

Maybe it would be good to create a ticket for a warning in case the <svg> does not have a <title> and a <desc>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y feature New feature or request for an a11y check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[A11Y FEATURE]: The page <title> should not be empty
2 participants