Description
This is a tracking issue for the rustdoc lint check_invalid_html_tags
.
There is no feature gate for this lint, but it is currently nightly-only.
check_invalid_html_tags
This lint warns about unclosed HTML tags and comments. See https://doc.rust-lang.org/nightly/rustdoc/lints.html#invalid_html_tags for more information.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implementation (Unclosed html tag lint #77119)
- Stabilization PR (see instructions on rustc-dev-guide)
Implementation history
- Initial implementation (Unclosed html tag lint #77119)
- Expanded to HTML comments (Check html comments #77753)
- Stabilization PR (Change default level of INVALID_HTML_TAGS to warning and stabilize it #101720)
Original issue
Rustdoc currently allows HTML in markdown, which is fine. The problem is that it doesn't sanitize the HTML at all, which means you can do wacky stuff like:
/// This is basically a Vec<Script>
pub enum ScriptExtension { /* ... */ }
impl ScriptExtension {
/// docs
pub fn some_func() {}
}
in which the Vec<Script>
parses as an opening script tag, and the rest of the docs just ... disappear
This isn't great, and it's kind of surprising. Perhaps we should sanitize these, or at least warn when it happens? This may not be easy or cheap, though.
Activity