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

title.multiple shouldn't be triggered for <title> inside <svg> #22

Open
gareth opened this issue Mar 13, 2018 · 5 comments
Open

title.multiple shouldn't be triggered for <title> inside <svg> #22

gareth opened this issue Mar 13, 2018 · 5 comments
Assignees
Labels

Comments

@gareth
Copy link

gareth commented Mar 13, 2018

SVG elements are allowed to have <title> elements contained within them, and this shouldn't be considered an SEO violation when embedded into an HTML page.

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title

@Johanndutoit
Copy link
Contributor

You are 100% correct, didn't think of that. See it's just looking for all titles in the HTML which is not right at https://github.com/passmarked/seo/blob/develop/lib/rules/title.js#L77.

Easy fix is probably to just check the head or just check if the parent, thoughts? Would be interested in beefing this up a bit more if you know of any more scenarios?

@gnclmorais
Copy link

MDN says:

Permitted parents
<head> element that contains no other <title> element.

So checking if it’s inside a <head> element and is unique is enough?

@Johanndutoit
Copy link
Contributor

@gnclmorais yes think you are on the money, will update to just look under <head>. Expect a PR in a few.

@gareth
Copy link
Author

gareth commented Mar 13, 2018

I guess this will also affect title.location too, thinking about it

@Johanndutoit
Copy link
Contributor

Thanks for the report, catching up on my workload now only. See #23 for the PR, will merge once tests pass

@Johanndutoit Johanndutoit self-assigned this Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants