Escape HTML with style using T-Strings!
Project description
SafeHTML
A simple package for safely rendering HTML using the new template string syntax (PEP 750), in Python 3.14.
Example
from safehtml import html
input = "Jacob <script>alert('xss')</script>"
print(html(t"<p>Hello {input}</p>"))
Output:
<p>Hello Jacob <script>alert('xss')</script></p>
Install
uv init
uv python pin 3.14.0rc1
uv add safehtml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
safehtml-1.0.1.tar.gz
(2.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safehtml-1.0.1.tar.gz.
File metadata
- Download URL: safehtml-1.0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1d3b001977d48f9afdeaf2f0f05c80a93c597912b6cde9a189bf1bc58fa9981
|
|
| MD5 |
e92e6bd45c541cbe850f206676f75969
|
|
| BLAKE2b-256 |
c0606e428764a0d45d1e56ae8b809012ae73d6e17e20e0f3da85d2ba01a944a3
|
File details
Details for the file safehtml-1.0.1-py3-none-any.whl.
File metadata
- Download URL: safehtml-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b75d868ccc738ec743493adf18164b1fd969f047314461e1c96eae24c4eda829
|
|
| MD5 |
acc46dc3696cf00f928f896970f5243e
|
|
| BLAKE2b-256 |
96efa224599b287f1c2207900eff5118aef5a7680720de61566b03f98740c298
|