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

Use better escape filters #288

Closed
vincerubinetti opened this issue Oct 28, 2024 · 0 comments · Fixed by #289
Closed

Use better escape filters #288

vincerubinetti opened this issue Oct 28, 2024 · 0 comments · Fixed by #289
Labels
enhancement New feature or request

Comments

@vincerubinetti
Copy link
Collaborator

#274 incorporates xml_escape in a bunch of places, which at least stops special characters from breaking HTML parsing. But we can make it better by using cgi_escape, uri_escape, strip_html, or a custom regex to strip whatever characters are appropriate for the context.

Examples:

  • alt or aria-label attributes should ideally remove all special characters, so that they're not announced by screen readers. xml_escape will leave behind HTML entities which are annoying to hear on a screen reader.
  • href and src attributes and CSS url() should probably use uri_escape.
@vincerubinetti vincerubinetti mentioned this issue Oct 28, 2024
3 tasks
@vincerubinetti vincerubinetti added the enhancement New feature or request label Oct 28, 2024
@vincerubinetti vincerubinetti mentioned this issue Nov 7, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant