bigskysoftware / bigskysoftware/htmx
BUG: hx-target with special characters fails
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
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`.



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

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(".").
Contributor guide
Research direction
The issue names no files or tests; first reproduce an hx-target containing a colon, hyphen, or dot and inspect the code that passes the target to document.querySelectorAll. Done means valid HTML IDs with these characters resolve correctly, including a regression check for the reported selector behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100