2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, pytestrunner
|
|
|
|
, six
|
|
|
|
, html5lib
|
|
|
|
, setuptools
|
2020-06-18 07:06:33 +00:00
|
|
|
, packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleach";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "3.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "sha256-mLMXBznl6D3Z3BljPwdHJ62EjL7bYCZwjIrC07aXpDM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytestrunner ];
|
2020-06-18 07:06:33 +00:00
|
|
|
propagatedBuildInputs = [ packaging six html5lib setuptools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Disable network tests
|
|
|
|
checkPhase = ''
|
|
|
|
pytest -k "not protocols"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
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";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ prikhi ];
|
|
|
|
};
|
|
|
|
}
|