diff --git a/docs/content/elements-attributes.md b/docs/content/elements-attributes.md index 1c75a3e5..02e9a9ee 100644 --- a/docs/content/elements-attributes.md +++ b/docs/content/elements-attributes.md @@ -155,7 +155,7 @@ and mix and match them with other attributes: ```rust # let _ = maud:: html! { - input #cannon .big .scary .bright-red type="button" value="Launch Party Cannon"; + input #cannon .big.scary.bright-red type="button" value="Launch Party Cannon"; } # ; ``` @@ -185,7 +185,7 @@ which otherwise wouldn't parse: ```rust # let _ = maud:: html! { - div ."col-sm-2" { "Bootstrap column!" } + div."col-sm-2" { "Bootstrap column!" } } # ; ``` diff --git a/docs/content/splices-toggles.md b/docs/content/splices-toggles.md index fda59b82..26b646d1 100644 --- a/docs/content/splices-toggles.md +++ b/docs/content/splices-toggles.md @@ -86,7 +86,7 @@ let severity = "critical"; # let _ = maud:: html! { aside #(name) { - p .{ "color-" (severity) } { "This is the worst! Possible! Thing!" } + p.{ "color-" (severity) } { "This is the worst! Possible! Thing!" } } } # ; @@ -146,7 +146,7 @@ And classes: let cuteness = 95; # let _ = maud:: html! { - p .cute[cuteness > 50] { "Squee!" } + p.cute[cuteness > 50] { "Squee!" } } # ; ``` diff --git a/maud/tests/basic_syntax.rs b/maud/tests/basic_syntax.rs index 471894dd..c3679dc5 100644 --- a/maud/tests/basic_syntax.rs +++ b/maud/tests/basic_syntax.rs @@ -189,7 +189,7 @@ fn hyphens_in_attribute_names() { #[test] fn class_shorthand() { - let result = html! { p { "Hi, " span .name { "Lyra" } "!" } }; + let result = html! { p { "Hi, " span.name { "Lyra" } "!" } }; assert_eq!( result.into_string(), r#"
Hi, Lyra!
"# @@ -197,8 +197,8 @@ fn class_shorthand() { } #[test] -fn class_shorthand_without_space() { - let result = html! { p { "Hi, " span.name { "Lyra" } "!" } }; +fn class_shorthand_with_space() { + let result = html! { p { "Hi, " span .name { "Lyra" } "!" } }; assert_eq!( result.into_string(), r#"Hi, Lyra!
"# @@ -207,7 +207,7 @@ fn class_shorthand_without_space() { #[test] fn classes_shorthand() { - let result = html! { p { "Hi, " span .name .here { "Lyra" } "!" } }; + let result = html! { p { "Hi, " span.name.here { "Lyra" } "!" } }; assert_eq!( result.into_string(), r#"Hi, Lyra!
"# @@ -216,7 +216,7 @@ fn classes_shorthand() { #[test] fn hyphens_in_class_names() { - let result = html! { p .rocks-these .are--my--rocks { "yes" } }; + let result = html! { p.rocks-these.are--my--rocks { "yes" } }; assert_eq!( result.into_string(), r#"yes
"# @@ -225,7 +225,7 @@ fn hyphens_in_class_names() { #[test] fn class_string() { - let result = html! { h1 ."pinkie-123" { "Pinkie Pie" } }; + let result = html! { h1."pinkie-123" { "Pinkie Pie" } }; assert_eq!( result.into_string(), r#"Awesome!
"#); } @@ -268,14 +268,14 @@ fn toggle_classes_braces() { fn toggle_classes_string() { let is_cupcake = true; let is_muffin = false; - let result = html! { p ."cupcake"[is_cupcake] ."is_muffin"[is_muffin] { "Testing!" } }; + let result = html! { p."cupcake"[is_cupcake]."is_muffin"[is_muffin] { "Testing!" } }; assert_eq!(result.into_string(), r#"Testing!
"#); } #[test] fn mixed_classes() { fn test(is_muffin: bool) -> Markup { - html!(p .cupcake .muffin[is_muffin] .lamington { "Testing!" }) + html!(p.cupcake.muffin[is_muffin].lamington { "Testing!" }) } assert_eq!( test(true).into_string(), @@ -307,7 +307,7 @@ fn id_string() { #[test] fn classes_attrs_ids_mixed_up() { - let result = html! { p { "Hi, " span .name .here lang="en" #thing { "Lyra" } "!" } }; + let result = html! { p { "Hi, " span.name.here lang="en" #thing { "Lyra" } "!" } }; assert_eq!( result.into_string(), r#"Hi, Lyra!
"# diff --git a/maud/tests/splices.rs b/maud/tests/splices.rs index 5c32bb85..eb568547 100644 --- a/maud/tests/splices.rs +++ b/maud/tests/splices.rs @@ -40,14 +40,14 @@ fn attributes() { #[test] fn class_shorthand() { let pinkie_class = "pinkie"; - let result = html! { p .(pinkie_class) { "Fun!" } }; + let result = html! { p.(pinkie_class) { "Fun!" } }; assert_eq!(result.into_string(), r#"Fun!
"#); } #[test] fn class_shorthand_block() { let class_prefix = "pinkie-"; - let result = html! { p .{ (class_prefix) "123" } { "Fun!" } }; + let result = html! { p.{ (class_prefix) "123" } { "Fun!" } }; assert_eq!(result.into_string(), r#"Fun!
"#); }