Skip to content

Commit 5fcbf46

Browse files
Add doc for invalid_html_tag lint
1 parent e6027a4 commit 5fcbf46

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/doc/rustdoc/src/lints.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,36 @@ warning: unknown attribute `should-panic`. Did you mean `should_panic`?
250250

251251
In the example above, the correct form is `should_panic`. This helps detect
252252
typo mistakes for some common attributes.
253+
254+
## invalid_html_tags
255+
256+
This lint **warns by default**. It detects unclosed or invalid HTML tags.
257+
For example:
258+
259+
```rust
260+
/// <h1>
261+
/// </script>
262+
pub fn foo() {}
263+
```
264+
265+
Which will give:
266+
267+
```text
268+
warning: unopened HTML tag `script`
269+
--> foo.rs:1:1
270+
|
271+
1 | / /// <h1>
272+
2 | | /// </script>
273+
| |_____________^
274+
|
275+
= note: `#[warn(invalid_html_tags)]` on by default
276+
277+
warning: unclosed HTML tag `h1`
278+
--> foo.rs:1:1
279+
|
280+
1 | / /// <h1>
281+
2 | | /// </script>
282+
| |_____________^
283+
284+
warning: 2 warnings emitted
285+
```

0 commit comments

Comments
 (0)