-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support 5xx
syntax for response-targets
#1564
Comments
Do you have a citation for that? Looks like it's allowed to me. |
Here you go!
The relevant part of the XML spec is the
As best as I can tell, the portion of the spec you linked applies to built-in attributes on built-in elements, but not to any custom stuff developers do. |
Let me know, if this is still an issue. Some config setting for that could be added in such case. |
I think I mostly agree with your interpretation of that spec, though it seems like that limitation only applies I'm not opposed to adding an alternate wildcard character, but frankly, it seems like a templating engine should support the broadest possible attribute definition. |
Ah! Sorry, I should have clarified: the reason I brought up It seems like the reason the spec doesn't spell that out is because the philosophy is "any behavior that isn't in the standard is, by definition, non-standard.", and the This rule is widely ignored because browsers make it work anyway and nobody cares. I don't care either, but it doesn't feel appropriate to me to argue to Maud that it should support syntax that exceeds either of the two mechanisms that enable custom attributes. @1cg, would you mind weighing in on whether HTMX has a preference for which which of the two portions of the spec to honor? I have found StackOverflow answer talking about this, and another claiming this is the case, and talking as if it's the only valid thing to do. HTMX also supports the Also, here's the W3 validator saying a custom attribute isn't allowed because it isn't a "global attribute" (enumerated attributes + |
Yup, my point was basically that I think the ship has sailed on this, hence |
Alright got the thumbs up on this. @spiffytech are you interested in PRing the |
Sure! |
on it |
Pull request: #1625 After changes will be merged the way to enable this functionality is going to be by adding: <meta name="htmx-config" content='{"responseTargetPadX":"on"}'> or by setting the |
…re#1564) # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js #
…re#1564) # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js #
…re#1564) # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Sun Jul 23 16:03:11 2023 -0400 # # On branch 1564-hx-target-5xx-syntax # Your branch is up to date with 'origin/1564-hx-target-5xx-syntax'. # # Changes to be committed: # modified: src/ext/response-targets.js # modified: test/ext/response-targets.js # modified: www/content/extensions/response-targets.md #
PR is up! #1629. |
It appears that Rust's
Maud
HTML templating tool doesn't support asterisks in HTML attribute names, as used in theresponse-targets
extension.I wouldn't be surprised if there are other tools that don't support the syntax, given I can't recall seeing it used anywhere else.
I considered asking Maud to add support, but it looks like the asterisks might violate the HTML spec: while HTML built-in attributes seem allowed to use them,
data-
attributes and attributes on custom elements can't.Given that, I request that the
response-targets
extension support an alternate wildcard syntax,hx-target-5xx
, that's unambiguously HTML-compliant.The text was updated successfully, but these errors were encountered: