-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Rustdoc generates invalid HTML header #113067
Copy link
Copy link
Closed
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The generated page HTML contains a
<div>tag in the header, which is not valid as per the HTML spec (which only allows "Metadata content"). This has been the case since #106915, which moved this div from the body to the header.I believe browsers will open the body if an invalid tag is encountered in the header (which you can see in inspect elements, where every item in between
</div></head>are inside of<body>), or something like that.This causes at least one bug: the
#![doc(html_favicon_url = "...")]attribute, which expands into a<link rel="icon" href="...">, is not displayed on Chrome and Chromium-based browsers.You can see this in the
timecrate on docs.rs:Generated HTML:
vs inspect element:
Manually moving the
linktag to the header correctly displays the favicon:2.