implement rfc 1054: split_whitespace() fn, deprecate words()
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
This commit is contained in:
parent
f43c86cda4
commit
c361e13d71
11 changed files with 53 additions and 28 deletions
|
|
@ -274,7 +274,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
|
|||
};
|
||||
|
||||
// Transform the contents of the header into a hyphenated string
|
||||
let id = s.words().map(|s| s.to_ascii_lowercase())
|
||||
let id = s.split_whitespace().map(|s| s.to_ascii_lowercase())
|
||||
.collect::<Vec<String>>().connect("-");
|
||||
|
||||
// This is a terrible hack working around how hoedown gives us rendered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue