2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-08-23 08:02:39 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, six
|
|
|
|
, html5lib
|
|
|
|
, setuptools
|
2022-11-02 22:02:43 +00:00
|
|
|
, tinycss2
|
2020-06-18 07:06:33 +00:00
|
|
|
, packaging
|
2021-08-23 08:02:39 +00:00
|
|
|
, pythonOlder
|
2022-11-02 22:02:43 +00:00
|
|
|
, webencodings
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleach";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "5.0.1";
|
2022-11-02 22:02:43 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-DQMlXEfrm9Lyaqm7fyEHcy5+j+GVyi9kcJ/POwpKCFw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-23 08:02:39 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
html5lib
|
2022-11-02 22:02:43 +00:00
|
|
|
packaging
|
2021-08-23 08:02:39 +00:00
|
|
|
setuptools
|
2022-11-02 22:02:43 +00:00
|
|
|
six
|
|
|
|
webencodings
|
2021-08-23 08:02:39 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
css = [
|
|
|
|
tinycss2
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-08-23 08:02:39 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-23 08:02:39 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Disable network tests
|
|
|
|
"protocols"
|
|
|
|
];
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"bleach"
|
|
|
|
];
|
2021-08-23 08:02:39 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An easy, HTML5, whitelisting HTML sanitizer";
|
|
|
|
longDescription = ''
|
|
|
|
Bleach is an HTML sanitizing library that escapes or strips markup and
|
|
|
|
attributes based on a white list. Bleach can also linkify text safely,
|
|
|
|
applying filters that Django's urlize filter cannot, and optionally
|
|
|
|
setting rel attributes, even on links already in the text.
|
|
|
|
|
|
|
|
Bleach is intended for sanitizing text from untrusted sources. If you
|
|
|
|
find yourself jumping through hoops to allow your site administrators
|
|
|
|
to do lots of things, you're probably outside the use cases. Either
|
|
|
|
trust those users, or don't.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/mozilla/bleach";
|
|
|
|
downloadPage = "https://github.com/mozilla/bleach/releases";
|
2021-08-23 08:02:39 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ prikhi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|