2018-01-07 10:01:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, pytestrunner
|
|
|
|
, six
|
|
|
|
, html5lib
|
2019-09-29 11:42:16 +01:00
|
|
|
, setuptools
|
2020-06-17 15:46:08 +01:00
|
|
|
, packaging
|
2018-01-07 10:01:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bleach";
|
2020-11-29 14:04:24 +00:00
|
|
|
version = "3.2.1";
|
2018-01-07 10:01:38 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-29 14:04:24 +00:00
|
|
|
sha256 = "52b5919b81842b1854196eaae5ca29679a2f2e378905c346d3ca8227c2c66080";
|
2018-01-07 10:01:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytest pytestrunner ];
|
2020-06-17 15:46:08 +01:00
|
|
|
propagatedBuildInputs = [ packaging six html5lib setuptools ];
|
2018-01-20 13:51:09 +00:00
|
|
|
|
2019-12-21 06:23:33 +00:00
|
|
|
# Disable network tests
|
2019-08-18 09:54:46 +01:00
|
|
|
checkPhase = ''
|
2019-12-21 06:23:33 +00:00
|
|
|
pytest -k "not protocols"
|
2019-08-18 09:54:46 +01:00
|
|
|
'';
|
|
|
|
|
2018-01-07 10:01:38 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/mozilla/bleach";
|
|
|
|
downloadPage = "https://github.com/mozilla/bleach/releases";
|
2018-01-07 10:01:38 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ prikhi ];
|
|
|
|
};
|
2018-03-17 14:42:09 +00:00
|
|
|
}
|