When compiling a HTML form containing labels with for attributes, I get the error
error: expected `>`
--> app/src/views/login.rs:18:24
|
18 | <label for="username">Username:</label>
| ^^^
error: aborting due to previous error
My current workaround is to use capitalisation to avoid the parser treating the attribute as a keyword (since Rust is case sensitive and HTML is not). For example:
When compiling a HTML form containing
label
s withfor
attributes, I get the errorMy current workaround is to use capitalisation to avoid the parser treating the attribute as a keyword (since Rust is case sensitive and HTML is not). For example:
There are four Rust keywords that are also valid HTML attributes:
async
,for
,loop
, andtype
. There already seems to be special handling fortype
inparse_attributes
: https://github.com/chinedufn/percy/blob/66e1dcd4ed94733160ec694dfcb2021be3d7503a/crates/html-macro/src/tag.rs#L131-L144I think the remaining three keywords just need to be added there. I will create a pull request for this change.