diff mbox series

[bug#49123,04/24] gnu: Add python-html-sanitizer.

Message ID 20210620010742.4259-4-0x2d@disroot.org
State New
Headers show
Series [bug#49123,01/24] gnu: Add pyotherside. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

slg June 20, 2021, 1:07 a.m. UTC
* gnu/packages/python-xyz.scm (python-html-sanitizer): New variable.
---
 gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

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)))