Add sanitized rich-text descriptions for content assets

Introduce HtmlTextField, which cleans submitted HTML with nh3 against a
tag/attribute allowlist, and use it for ContentAsset.description via
Meta.field_classes. Edit descriptions with TinyMCE and render the
sanitized HTML on the asset page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shaun Kruger
2026-12-01 20:57:31 -07:00
co-authored by Claude Opus 5.5
parent 3fe49b47ea
commit 5bb9a70c11
6 changed files with 74 additions and 1 deletions
+1
View File
@@ -16,6 +16,7 @@ dependencies = [
"whitenoise~=6.11.0",
"pytz~=2026.5",
"django-allauth[socialaccount]~=65.0.2",
"nh3==0.2.20",
]
dynamic = ["version"]