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

Better HTML5 conformance #1924

Merged
merged 4 commits into from
Nov 13, 2022
Merged

Conversation

averms
Copy link
Contributor

@averms averms commented Nov 12, 2022

Four minor changes to the templates to improve HTML5 conformance. Here is the commit log

State canonical URL using <link> not <meta>.

The Google SEO docs describe using the link element to specify the canonical
page in a redirect. They don't mention anything about <meta>.

----

Fix formatting of content attr in <meta http-equiv=refresh>

According to the HTML specification[1], there needs to be a space after the
semicolon and the URL must be unquoted.

[1]: https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh

----

Don't generate obsolete charset attrs in <script>.

According to the HTML specification[1], the charset attribute is obsolete in
script elements.

[1]: https://html.spec.whatwg.org/multipage/obsolete.html#HTMLScriptElement-partial

----

Don't generate redundant <meta http-equiv=content-type>.

Quoting from the HTML specification[1]:

> A document must not contain both a meta element with an http-equiv attribute
> in the Encoding declaration state and a meta element with the charset
> attribute present.

So we remove the <meta> with the http-equiv attribute from our template.

[1]: https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-type

Quoting from the HTML specification[1]:

  A document must not contain both a meta element with an http-equiv attribute
  in the Encoding declaration state and a meta element with the charset
  attribute present.

So we remove the <meta> with the http-equiv attribute from our template.

[1]: https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-content-type
According to the HTML specification[1], the charset attribute is obsolete in
script elements.

[1]: https://html.spec.whatwg.org/multipage/obsolete.html#HTMLScriptElement-partial
According to the HTML specification[1], there needs to be a space after the
semicolon and the URL must be unquoted.

[1]: https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh
The Google SEO docs describe using the link element to specify the canonical
page in a redirect. They don't mention anything about <meta>.
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss merged commit d45f02d into rust-lang:master Nov 13, 2022
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

Successfully merging this pull request may close these issues.

2 participants