(Posting this here since I don't have time to fix this right now.)
Attribute values are currently rendered using the same Render trait that full templates use, which makes it easy to generate invalid markup:
markup::define! {
A { #a {} }
B { div[a = A {}] {} }
}
fn main() {
println!("{}", B {});
}
=>
<div a="<div id="a"></div>"></div>
I think there should be a separate trait (that probably inherits markup::Render) for things that are allowed to be in attribute values and it should only be implemented by simple values like numbers, strings, booleans, and options that wrap them, and not templates defined by markup::define! or markup::new!.
(Posting this here since I don't have time to fix this right now.)
Attribute values are currently rendered using the same
Render
trait that full templates use, which makes it easy to generate invalid markup:=>
I think there should be a separate trait (that probably inherits markup::Render) for things that are allowed to be in attribute values and it should only be implemented by simple values like numbers, strings, booleans, and options that wrap them, and not templates defined by
markup::define!
ormarkup::new!
.