diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index d28513bd..a4e65fab 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -792,7 +792,7 @@ fn build_header_links(html: &str) -> String { static BUILD_HEADER_LINKS: Lazy = Lazy::new(|| { Regex::new(r#"(.*?)"#).unwrap() }); - static IGNORE_CLASS: &'static [&str] = &["menu-title"]; + static IGNORE_CLASS: &[&str] = &["menu-title"]; let mut id_counter = HashMap::new(); @@ -835,7 +835,7 @@ fn insert_link_into_header( let classes = classes.unwrap_or("".to_string()); format!( - r##"{text}"##, + r##"{text}"##, level = level, id = id, text = content, @@ -1014,27 +1014,31 @@ mod tests { let inputs = vec![ ( "blah blah

Foo

", - r##"blah blah

Foo

"##, + r##"blah blah

Foo

"##, ), ( "

Foo

", - r##"

Foo

"##, + r##"

Foo

"##, ), ( "

Foo^bar

", - r##"

Foo^bar

"##, + r##"

Foo^bar

"##, ), ( "

", - r##"

"##, + r##"

"##, ), ( "

", - r##"

"##, + r##"

"##, ), ( "

Foo

Foo

", - r##"

Foo

Foo

"##, + r##"

Foo

Foo

"##, + ), + ( + r##"

Foo

"##, + r##"

Foo

"##, ), ]; diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index 813f70fd..9fffe7bc 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -105,12 +105,12 @@ fn check_correct_cross_links_in_nested_dir() { assert_contains_strings( first.join("index.html"), - &[r##"

"##], + &[r##"

"##], ); assert_contains_strings( first.join("nested.html"), - &[r##"

"##], + &[r##"

"##], ); } @@ -393,7 +393,7 @@ fn able_to_include_files_in_chapters() { let includes = temp.path().join("book/first/includes.html"); let summary_strings = &[ - r##"

Summary

"##, + r##"

Summary

"##, ">First Chapter", ]; assert_contains_strings(&includes, summary_strings);