-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #103505 - notriddle:notriddle/rustdoc-self-closing-ta…
…gs, r=GuillaumeGomez rustdoc: parse self-closing tags and attributes in `invalid_html_tags` Fixes #103460
- Loading branch information
Showing
3 changed files
with
204 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#![deny(rustdoc::invalid_html_tags)] | ||
|
||
/// <p/> | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct A; | ||
|
||
/// <p style/> | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct B; | ||
|
||
/// <p style=""/> | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct C; | ||
|
||
/// <p style="x"/> | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct D; | ||
|
||
/// <p style="x/></p> | ||
//~^ ERROR unclosed quoted HTML attribute | ||
pub struct E; | ||
|
||
/// <p style='x/></p> | ||
//~^ ERROR unclosed quoted HTML attribute | ||
pub struct F; | ||
|
||
/// <p style="x/"></p> | ||
pub struct G; | ||
|
||
/// <p style="x/"/> | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct H; | ||
|
||
/// <p / > | ||
//~^ ERROR invalid self-closing HTML tag `p` | ||
pub struct I; | ||
|
||
/// <br/> | ||
pub struct J; | ||
|
||
/// <a href=/></a> | ||
pub struct K; | ||
|
||
/// <a href=//></a> | ||
pub struct L; | ||
|
||
/// <a href="/"/> | ||
//~^ ERROR invalid self-closing HTML tag `a` | ||
pub struct M; | ||
|
||
/// <a href=x /> | ||
//~^ ERROR invalid self-closing HTML tag `a` | ||
pub struct N; | ||
|
||
/// <a href= /> | ||
//~^ ERROR invalid self-closing HTML tag `a` | ||
pub struct O; | ||
|
||
/// <a href=x/></a> | ||
pub struct P; | ||
|
||
/// <svg><rect width=1 height=1 /></svg> | ||
pub struct Q; | ||
|
||
/// <svg><rect width=1 height=/></svg> | ||
//~^ ERROR unclosed HTML tag `rect` | ||
pub struct R; | ||
|
||
/// <svg / q> | ||
pub struct S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:3:5 | ||
| | ||
LL | /// <p/> | ||
| ^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/invalid-html-self-closing-tag.rs:1:9 | ||
| | ||
LL | #![deny(rustdoc::invalid_html_tags)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:7:5 | ||
| | ||
LL | /// <p style/> | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:11:5 | ||
| | ||
LL | /// <p style=""/> | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:15:5 | ||
| | ||
LL | /// <p style="x"/> | ||
| ^^ | ||
|
||
error: unclosed quoted HTML attribute on tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:19:14 | ||
| | ||
LL | /// <p style="x/></p> | ||
| ^ | ||
|
||
error: unclosed quoted HTML attribute on tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:23:14 | ||
| | ||
LL | /// <p style='x/></p> | ||
| ^ | ||
|
||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:30:5 | ||
| | ||
LL | /// <p style="x/"/> | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `p` | ||
--> $DIR/invalid-html-self-closing-tag.rs:34:5 | ||
| | ||
LL | /// <p / > | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `a` | ||
--> $DIR/invalid-html-self-closing-tag.rs:47:5 | ||
| | ||
LL | /// <a href="/"/> | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `a` | ||
--> $DIR/invalid-html-self-closing-tag.rs:51:5 | ||
| | ||
LL | /// <a href=x /> | ||
| ^^ | ||
|
||
error: invalid self-closing HTML tag `a` | ||
--> $DIR/invalid-html-self-closing-tag.rs:55:5 | ||
| | ||
LL | /// <a href= /> | ||
| ^^ | ||
|
||
error: unclosed HTML tag `rect` | ||
--> $DIR/invalid-html-self-closing-tag.rs:65:10 | ||
| | ||
LL | /// <svg><rect width=1 height=/></svg> | ||
| ^^^^^ | ||
|
||
error: aborting due to 12 previous errors | ||
|