Skip to content
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

Ensure proper handling of hx attributes #17

Closed
3 tasks
egil opened this issue Apr 22, 2024 · 1 comment
Closed
3 tasks

Ensure proper handling of hx attributes #17

egil opened this issue Apr 22, 2024 · 1 comment

Comments

@egil
Copy link
Owner

egil commented Apr 22, 2024

If the value in hx attributes contains certain characters used in javascript, these are escaped by default by the renderer. That breaks functionality.

  • Enable easy serialization of object into hx-header and hx-vals attributes, such that the JSON is correctly embedded in the markup.
  • Ensure hx attributes values are escaped as expected.

Attributes that contains JSON or JavaScript

@egil egil mentioned this issue Apr 22, 2024
7 tasks
@egil egil changed the title Enable easy serialization of object into hx-header and hx-vals attributes, such that the JSON is correctly embedded in the markup. Easy serialization of object into hx-header and hx-vals attributes Apr 22, 2024
@egil egil changed the title Easy serialization of object into hx-header and hx-vals attributes Ensure proper handling of hx attributes Apr 22, 2024
@egil
Copy link
Owner Author

egil commented Apr 29, 2024

Looks like all basic cases work. Users just need to choose either single or double quotes around the attribute value, and then use the opposite inside the value for the json properties and values.

@egil egil closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant