bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
37.13k stars 1.25k forks source link

BUG: hx-target with special characters fails #2601

Open pragmatta opened 3 months ago

pragmatta commented 3 months ago

If you have a hx-target that is an id that has special characters like the colon fails because they need to be escaped for document.querySelectorAll.

image image image

Same happens on console and you can fix it by adding a \\. image

HTML spec allows at least hyphens and colons and dots to be used. https://www.w3.org/TR/html4/types.html#:~:text=ID%20and%20NAME%20tokens%20must,periods%20(".").

pragmatta commented 3 months ago

Created a fix and a pull request for this: https://github.com/bigskysoftware/htmx/pull/2602/files