Open gareth opened 6 years ago
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?
Permitted parents A
<head>
element that contains no other<title>
element.
So checking if it’s inside a <head>
element and is unique is enough?
@gnclmorais yes think you are on the money, will update to just look under <head>
. Expect a PR in a few.
I guess this will also affect title.location
too, thinking about it
Thanks for the report, catching up on my workload now only. See https://github.com/passmarked/seo/pull/23 for the PR, will merge once tests pass
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