Subject: [PATCH 04/24] gnu: Add python-html-sanitizer.

From: slg <[email-masked]>
Date: Sat, 19 Jun 2021 22:07:22 -0300

* gnu/packages/python-xyz.scm (python-html-sanitizer): New variable.
---
 gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bb263a6f20..54c7d91116 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25990,3 +25990,26 @@ is the cythonized version of @code{fractions.Fraction}.")
      "@code{pathvalidate} is a Python library to sanitize/validate strings
 representing paths or filenames.")
     (license license:expat)))
+
+(define-public python-html-sanitizer
+  (package
+    (name "python-html-sanitizer")
+    (version "1.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "html-sanitizer" version))
+       (sha256
+        (base32 "1mb9d80mar5y4ariqbmrxn5llcffh5qp3s3ywd05bxgg7jzaxh0k"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-lxml" ,python-lxml)
+       ("python-beautifulsoup4" ,python-beautifulsoup4)))
+    (home-page "https://github.com/matthiask/html-sanitizer")
+    (synopsis "Python library to sanitize HTML")
+    (description "This is a allowlist-based and very opinionated HTML sanitizer
+that can be used both for untrusted and trusted sources.  It attempts to clean
+up the mess made by various rich text editors and or copy-pasting to make
+styling of webpages simpler and more consistent.  It builds on the excellent
+HTML cleaner in lxml to make the result both valid and safe.")
+    (license license:bsd-3)))
-- 
2.32.0