Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustdoc/passes/html_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl<'a, 'tcx> DocVisitor for InvalidHtmlTagsLinter<'a, 'tcx> {
for (event, range) in p {
match event {
Event::Start(Tag::CodeBlock(_)) => in_code_block = true,
Event::Html(text) | Event::Text(text) if !in_code_block => {
Event::Html(text) if !in_code_block => {
extract_tags(&mut tags, &text, range, &mut is_in_comment, &report_diag)
}
Event::End(Tag::CodeBlock(_)) => in_code_block = false,
Expand Down
7 changes: 7 additions & 0 deletions src/test/rustdoc-ui/invalid-html-tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ pub fn k() {}
/// Web Components style </unopened-tag>
//~^ ERROR unopened HTML tag `unopened-tag`
pub fn m() {}

/// backslashed \<a href="">
pub fn no_error_1() {}

/// backslashed \<<a href="">
//~^ ERROR unclosed HTML tag `a`
pub fn p() {}
8 changes: 7 additions & 1 deletion src/test/rustdoc-ui/invalid-html-tags.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,11 @@ error: unclosed HTML tag `dashed-tags`
LL | /// Web Components style <dashed-tags>
| ^^^^^^^^^^^^^

error: aborting due to 15 previous errors
error: unclosed HTML tag `a`
--> $DIR/invalid-html-tags.rs:121:19
|
LL | /// backslashed \<<a href="">
| ^^

error: aborting due to 16 previous errors