summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/python-modules/html-sanitizer/default.nix21
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/html-sanitizer/default.nix b/pkgs/development/python-modules/html-sanitizer/default.nix
new file mode 100644
index 00000000000..17783f38d1f
--- /dev/null
+++ b/pkgs/development/python-modules/html-sanitizer/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildPythonPackage, fetchFromGitHub, lxml, beautifulsoup4, pytest, pytestrunner }:
+
+buildPythonPackage rec {
+  pname = "html-sanitizer";
+  version = "1.9.1";
+
+  src = fetchFromGitHub {
+    owner = "matthiask";
+    repo = pname;
+    rev = version;
+    sha256 = "0nnv34924r0yn01rwlk749j5ijy7yxyj302s1i57yjrkqr3zlvas";
+  };
+
+  propagatedBuildInputs = [ lxml beautifulsoup4 ];
+
+  meta = with lib; {
+    description = "An  allowlist-based and very opinionated HTML sanitizer that can be used both for untrusted and trusted sources.";
+    homepage = "https://github.com/matthiask/html-sanitizer";
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 4c427591167..dc40a0668a7 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -4153,6 +4153,8 @@ in {
 
   htmllaundry = callPackage ../development/python-modules/htmllaundry { };
 
+  html-sanitizer = callPackage ../development/python-modules/html-sanitizer { };
+
   html5lib = callPackage ../development/python-modules/html5lib { };
 
   httmock = callPackage ../development/python-modules/httmock { };