Closed 17dec closed 5 years ago
I'm glad you like it!
A function to parse this kind of thing already existed; not sure how I forgot to use it here earlier. Putting type
and data-id
in quotes should now work:
markup::define! {
Hello {
// "type" is a keyword, so this fails
input["type"="number"]
// '-' isn't allowed in an identifier
br["data-id"=1]
}
}
Let me know if you still have issues with this.
Works, thanks!
I improved this further by making the parser treat keywords like they're identifiers. You can do input[type = "number"]
now as of version 0.1.4!
Thanks for this crate - I'm loving its elegant and simple design.
Is there a way to set attributes that aren't rust identifiers? For example:
Supporting string literals as attribute names might be a clean way to solve this.