August 2024
Intermediate to advanced
186 pages
4h 3m
English
It’s common for htmx endpoints to insert user-supplied text into the HTML to be returned. Endpoints should escape all user-supplied text before inserting it. This involves replacing the following characters with their character entity equivalents:
Replacing angle brackets prevents <script> tags in user-supplied content from being executed by the browser.
Many HTML templating approaches perform escaping automatically. In the Hono TypeScript library, strings processed by the html tagged template literal are escaped. In the Python Flask framework, strings are escaped when they are passed to a Jinja template.
As a best practice, ...
Read now
Unlock full access