diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-09-24 13:49:40 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-10-03 14:16:24 +0200 |
| commit | 5fcbf4668ecab0ff798ea076757e27760c90aff5 (patch) | |
| tree | ea0ac87c13fa169fe68596a70862a68f5af4b968 /src/doc | |
| parent | e6027a42e109fef10f4fc27ebede50d1b3d203f0 (diff) | |
| download | rust-5fcbf4668ecab0ff798ea076757e27760c90aff5.tar.gz rust-5fcbf4668ecab0ff798ea076757e27760c90aff5.zip | |
Add doc for invalid_html_tag lint
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustdoc/src/lints.md | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/lints.md b/src/doc/rustdoc/src/lints.md index 3e632a0644a..d6ae665ba05 100644 --- a/src/doc/rustdoc/src/lints.md +++ b/src/doc/rustdoc/src/lints.md @@ -250,3 +250,36 @@ warning: unknown attribute `should-panic`. Did you mean `should_panic`? In the example above, the correct form is `should_panic`. This helps detect typo mistakes for some common attributes. + +## invalid_html_tags + +This lint **warns by default**. It detects unclosed or invalid HTML tags. +For example: + +```rust +/// <h1> +/// </script> +pub fn foo() {} +``` + +Which will give: + +```text +warning: unopened HTML tag `script` + --> foo.rs:1:1 + | +1 | / /// <h1> +2 | | /// </script> + | |_____________^ + | + = note: `#[warn(invalid_html_tags)]` on by default + +warning: unclosed HTML tag `h1` + --> foo.rs:1:1 + | +1 | / /// <h1> +2 | | /// </script> + | |_____________^ + +warning: 2 warnings emitted +``` |
