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

Valid HTML Improvement: ul tag for language switch shouldn't be a child of a span #599

Closed
drohen opened this issue Oct 24, 2021 · 3 comments

Comments

@drohen
Copy link

drohen commented Oct 24, 2021

I tried validating the HTML of my website, and it failed on the Site-level language switch. The ul tag used to list the available languages is a block-level element, and this is nested within various span elements. As span is a phrasing element, it also should only contain phrasing elements. Either the ul should be replaced with something else, or the parent tags should be changed to something like a div.

If you would prefer me to make a PR for this I can do so.

@adityatelange
Copy link
Owner

Is HTML validation everything? Like a <span> here works the same as using 2 or more CSS rules. It gets the job done.

@louisfoster
Copy link

I figured as it's a blog theme, blogs generally contain valid HTML to help with parsers for search engine indexing and accessibility. I was merely pointing this out in case you weren't aware. It's your theme, If you're not concerned, then feel free to close the issue.

@kenohassler kenohassler mentioned this issue Dec 14, 2021
7 tasks
@Rotzbua
Copy link
Contributor

Rotzbua commented Mar 28, 2022

I observed the same problems.

W3 validator

Current demo

https://validator.w3.org/nu/?doc=https%3A%2F%2Fadityatelange.github.io%2Fhugo-PaperMod%2F

Error output

grafik

Warning output

grafik

Solution

Created two PRs which solved the problems for my setup. Not sure if they solve it for every configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants