This may be a 'working as intended' situation, but I thought I'd raise the issue in case it's not:
Currently, if you're applying a class to an element optionally, but the condition is falsey, maud still generates a 'class' attribute, but with an empty class list.
Ex.
use maud::{html, Render};
fn main() {
let demo_output = html! {
p .someClass[false] {
"Lorem Ipsum"
}
}
.render();
println!("Generated html: {}", demo_output.0);
}
This may be a 'working as intended' situation, but I thought I'd raise the issue in case it's not:
Currently, if you're applying a class to an element optionally, but the condition is falsey, maud still generates a 'class' attribute, but with an empty class list.
Ex.
Output:
Generated html: <p class="">Lorem Ipsum</p>
Note that a 'class' attribute is generated, even though it isn't needed.
Definitely not a huge deal, but it would be nice to keep the HTML trim where possible.