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:
kwantam 2015-04-18 13:49:51 -04:00
parent f43c86cda4
commit c361e13d71
11 changed files with 53 additions and 28 deletions

View file

@ -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