Skip to content

Commit e50fed7

Browse files
committed
add regression test for #145529
1 parent 6ba0ce4 commit e50fed7

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

tests/rustdoc-ui/lints/invalid-html-tags.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,34 @@ pub fn no_error_1() {}
121121
/// backslashed \<<a href="">
122122
//~^ ERROR unclosed HTML tag `a`
123123
pub fn p() {}
124+
125+
/// <svg width="512" height="512" viewBox="0 0 512" fill="none" xmlns="http://www.w3.org/2000/svg">
126+
/// <rect
127+
/// width="256"
128+
/// height="256"
129+
/// fill="#5064C8"
130+
/// stroke="black"
131+
/// />
132+
/// </svg>
133+
pub fn no_error_2() {}
134+
135+
/// <div>
136+
/// <img
137+
/// src="https://example.com/ferris.png"
138+
/// width="512"
139+
/// height="512"
140+
/// />
141+
/// </div>
142+
pub fn no_error_3() {}
143+
144+
/// unfinished ALLOWED_UNCLOSED
145+
///
146+
/// <br>
147+
/// <img
148+
//~^ ERROR unclosed HTML tag `img`
149+
pub fn q() {}
150+
151+
/// nested unfinished ALLOWED_UNCLOSED
152+
/// <p><img</p>
153+
//~^ ERROR unclosed HTML tag `img`
154+
pub fn r() {}

tests/rustdoc-ui/lints/invalid-html-tags.stderr

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,17 @@ error: unclosed HTML tag `a`
100100
LL | /// backslashed \<<a href="">
101101
| ^^
102102

103-
error: aborting due to 16 previous errors
103+
error: unclosed HTML tag `img`
104+
--> $DIR/invalid-html-tags.rs:147:5
105+
|
106+
LL | /// <img
107+
| ^^^
108+
109+
error: unclosed HTML tag `img`
110+
--> $DIR/invalid-html-tags.rs:152:8
111+
|
112+
LL | /// <p><img</p>
113+
| ^^^^
114+
115+
error: aborting due to 18 previous errors
104116

0 commit comments

Comments
 (0)