Skip to content

Commit

Permalink
Revert "rustdoc: Hide #text in doc-tests"
Browse files Browse the repository at this point in the history
This reverts commit af6c320.
  • Loading branch information
davidhewitt committed Apr 24, 2021
1 parent e11a9fa commit 5b05f68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 44 deletions.
19 changes: 6 additions & 13 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,12 @@ fn map_line(s: &str) -> Line<'_> {
let trimmed = s.trim();
if trimmed.starts_with("##") {
Line::Shown(Cow::Owned(s.replacen("##", "#", 1)))
} else if trimmed.starts_with('#') {
let mut without_hash = trimmed[1..].trim_start();
if without_hash.starts_with('!') {
// #! text
without_hash = without_hash[1..].trim_start_matches(' ');
}
if without_hash.starts_with('[') {
// #[attr] or #![attr]
Line::Shown(Cow::Borrowed(s))
} else {
// #text
Line::Hidden(without_hash)
}
} else if let Some(stripped) = trimmed.strip_prefix("# ") {
// # text
Line::Hidden(&stripped)
} else if trimmed == "#" {
// We cannot handle '#text' because it could be #[attr].
Line::Hidden("")
} else {
Line::Shown(Cow::Borrowed(s))
}
Expand Down
25 changes: 0 additions & 25 deletions src/test/rustdoc-ui/test-hidden.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/test/rustdoc-ui/test-hidden.stdout

This file was deleted.

0 comments on commit 5b05f68

Please sign in to comment.