-
Notifications
You must be signed in to change notification settings - Fork 145
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
Allow attributes with special characters #194
Comments
Hi @edg-l! According to the Alpine.js docs, you can use:
As mentioned in #134, I'd rather not add special syntax to support languages other than HTML. So I'll go ahead and close this. Let me know if you have any other questions! |
Hello @lambda-fairy, I just stumbled another incompatibility between maud and alpine. In alpine, you can use modifiers which customise the event handler. For example, you can do In Maud, the dot character is used to denote a class. Using modifiers in maud templates leads to syntax errors. I'm thinking maud could support quoted attribute name like this:
As you can see this could as well solve the problem explained by @edg-l. What do you think? If looks ok to you, I could look into integrating the proposal in maud. Thanks a lot! |
As another data point, HTMX is working on a very useful extension that uses numbers and asterisks in element attributes. Its usage looks like this: <button hx-post="/register"
hx-target="#response-div"
hx-target-5*="#serious-errors"
hx-target-404="#not-found">
Register!
</button> It looks like the I'm unsure how to proceed in cases like this. Should I fall back to stuffing a hand-written Would you consider reopening this? @charlesvdv's proposed syntax appears to solve this. |
I ran into the same issue with |
Hi all, sorry for the delayed response. I guess that given how many people use Maud with Alpine/HTMX/etc. it's worth supporting their weird syntaxes (despite it being technically invalid HTML 😔). I'll be happy to take a PR with @charlesvdv's suggestion. Thanks! |
Just to add to this. It's not even possible to use regular htmx as of today. This prevents us from using |
Also doesn't work for alpine custom events: https://alpinejs.dev/directives/on
|
As mentioned in #396 (comment), the current implementation accepts a bit too much. Let's restrict the syntax before cutting a release. |
I think you should be able to somehow use "@click" as an attribute name, this comes in handy when using a library like alpinejs
The text was updated successfully, but these errors were encountered: