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

rustdoc::invalid_html_tags does not understand SVG self-closing tags #103460

Closed
kpreid opened this issue Oct 24, 2022 · 0 comments · Fixed by #103505
Closed

rustdoc::invalid_html_tags does not understand SVG self-closing tags #103460

kpreid opened this issue Oct 24, 2022 · 0 comments · Fixed by #103505
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@kpreid
Copy link
Contributor

kpreid commented Oct 24, 2022

Given the following code:

/// <svg><rect width=1 height=1 /></svg>
pub fn foo() {}

The current output of cargo +nightly doc is:

warning: unclosed HTML tag `rect`
 --> src/lib.rs:1:10
  |
1 | /// <svg><rect width=1 height=1 /></svg>
  |          ^^^^^
  |
  = note: `#[warn(rustdoc::invalid_html_tags)]` on by default

warning: `scratchpad` (lib doc) generated 1 warning

But it is valid to use /> self-closing tags for SVG embedded in HTML, so this markup is not incorrect. There should be no warning.

rustdoc 1.66.0-nightly (7fcf850d7 2022-10-23)
binary: rustdoc
commit-hash: 7fcf850d7942804990a1d2e3fe036622a0fe4c74
commit-date: 2022-10-23
host: x86_64-apple-darwin
release: 1.66.0-nightly
LLVM version: 15.0.2

cc #67799

@rustbot label +T-rustdoc -T-compiler

@kpreid kpreid added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2022
@rustbot rustbot added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 27, 2022
…losing-tags, r=GuillaumeGomez

rustdoc: parse self-closing tags and attributes in `invalid_html_tags`

Fixes rust-lang#103460
@bors bors closed this as completed in f9cace0 Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants