-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elements as attribute values #14
Comments
Technically it's not that simple. Array of attributes is parsing using parse_tokens_with_ending, which limit parsing context to one that ends with Parsing attribute value as `syn::Expr` already violate html5 spec, which expects no spaces inside unquoted attribute values.
I think we can violate it further, but it should not obscure end-users. In order to do it we should reduce amount of mixing parsing context, not increasing it (or at-least try to mark mixed context, like templating syntax in js). For original issue, i understand that nobody likes writing more boilerplate code, but i also think there is second problem with using |
Makes sense as a way of avoiding ambiguity. I guess I'd say... any attribute value that starts with But I'm sure you know much more than I do about the actual parsing here.
I see JSX as the thing to compare to here: something like It would be nice from my end to have the flexibility but I understand if it's not possible or would be too much added complexity! |
Yes, that what i meant when said "at-least to mark mixed context" - it would be easier for user to find it, and for parser to understand.
Good point. But in that quote i was talking more about And if that would change, we also should change Maybe someone can figure out easier way. |
leptos-rs/leptos#766 makes an interesting proposal for shortening much Leptos boilerplate.
If
KeyedAttributeValue
could itself be aNode
, thencould be shortened to
i.e., the framework could choose to expand any
key={fragment or element}
to|cx| {that fragment or element}
The text was updated successfully, but these errors were encountered: