mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 23:02:38 +00:00
uucore: add comment to parse_help_section
This commit is contained in:
parent
2f0ba77872
commit
3b54421e9c
1 changed files with 4 additions and 1 deletions
|
@ -170,11 +170,14 @@ fn parse_help_section(section: &str, content: &str) -> String {
|
|||
)
|
||||
}
|
||||
|
||||
// Prefix includes space to allow processing of section with level 3-6 headers
|
||||
let section_header_prefix = "## ";
|
||||
|
||||
content
|
||||
.lines()
|
||||
.skip_while(|&l| !is_section_header(l, section))
|
||||
.skip(1)
|
||||
.take_while(|l| !l.starts_with("## "))
|
||||
.take_while(|l| !l.starts_with(section_header_prefix))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n")
|
||||
.trim()
|
||||
|
|
Loading…
Reference in a new issue