2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lxml
|
|
|
|
, beautifulsoup4
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "html-sanitizer";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "1.9.3";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matthiask";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-1JSdi1PFM+N+UuEPfgWkOZw8S2PZ4ntadU0wnVJNnjw=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
lxml
|
|
|
|
beautifulsoup4
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"html_sanitizer/tests.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-04-27 09:35:20 +00:00
|
|
|
# Tests are sensitive to output
|
2022-01-26 04:04:25 +00:00
|
|
|
"test_billion_laughs"
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_10_broken_html"
|
2022-01-26 04:04:25 +00:00
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"html_sanitizer"
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Allowlist-based and very opinionated HTML sanitizer";
|
2020-07-18 16:06:22 +00:00
|
|
|
homepage = "https://github.com/matthiask/html-sanitizer";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|