about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-07 15:30:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-07 17:54:34 -0700
commitdbaa24241834e124995753a2eba18d787e288845 (patch)
tree1baca3d271ef2be0b030123ca9321579c7db79c5 /src/librustdoc/html
parent11b1ff190017740308e9f17422a8b42e2223e75a (diff)
downloadrust-dbaa24241834e124995753a2eba18d787e288845.tar.gz
rust-dbaa24241834e124995753a2eba18d787e288845.zip
rustdoc: Handle tests with bare `#` marks
Strip them from output like other `# `-starting lines.

Closes #23106
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/markdown.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 215f83ff87e..cb80d071ce4 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -183,7 +183,9 @@ impl hoedown_buffer {
 /// left as-is.)
 fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> {
     let trimmed = s.trim();
-    if trimmed.starts_with("# ") {
+    if trimmed == "#" {
+        Some("")
+    } else if trimmed.starts_with("# ") {
         Some(&trimmed[2..])
     } else {
         None