Rollup merge of #46387 - chrisduerr:master, r=QuietMisdreavus
Fix rustdoc item summaries that are headers Rustoc item summaries that are headers were not displayed at all because they started with whitespace. This PR fixes this and now removes the whitespace and then displays the block. I'm not sure if the rustdoc test is written correctly, if there's anything to improve, just let me know. :) This fixes #46377. This is how it looks when rendered out now: 
This commit is contained in:
commit
bc8e8fabbf
2 changed files with 16 additions and 1 deletions
|
|
@ -1819,7 +1819,9 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
|
|||
|
||||
fn shorter<'a>(s: Option<&'a str>) -> String {
|
||||
match s {
|
||||
Some(s) => s.lines().take_while(|line|{
|
||||
Some(s) => s.lines()
|
||||
.skip_while(|s| s.chars().all(|c| c.is_whitespace()))
|
||||
.take_while(|line|{
|
||||
(*line).chars().any(|chr|{
|
||||
!chr.is_whitespace()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue