-
Notifications
You must be signed in to change notification settings - Fork 25
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
Some node names that include numbers are not parsed #43
Comments
Turning the fragment into an An alternative would be to switch an approach that also relies on rust-lang/rust#54725, just like the quoted text feature. Basically: Parse all tree tokens until we hit any of the not allowed chars. But given that's nightly only, it's probably not something that would work as solution right now for your consumers? Because further expanding the |
I'd be comfortable relying on nightly if people want to be able to use this particular kind of node name. (As long as the library also works without nightly and just works as it does currently!) We already encourage nightly for some features it enables, with an opt-out feature for stable, so it would work for me at least. |
Didn't have a chance to continue working on this and probably won't for some time still. There's an |
Per the HTML spec, an attribute name like
data-id-25
is valid (albeit maybe unusual)This can't be parsed by
syn-rsx
at present because each segment of the node name needs to be anIdent
, and25
isn't a valid Rust identifier.You're probably more familiar with
syn
than I am but I wonder if changing thePunctuated
variant ofNodeName
to something likewhere
would be a possibility. This only expands the possibilities to include numbers, and not other possibly-valid attribute names that aren't valid Rust identifiers, but would be a start.
Here's an issue in my repo with an example of where someone would use it—using a
class:
syntax to toggle a Tailwind-like CSS class name that included a number after a dash.The text was updated successfully, but these errors were encountered: