1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytest
5, pytestrunner
6, six
7, html5lib
8}:
9
10buildPythonPackage rec {
11 pname = "bleach";
12 version = "2.1.2";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "38fc8cbebea4e787d8db55d6f324820c7f74362b70db9142c1ac7920452d1a19";
17 };
18
19 checkInputs = [ pytest pytestrunner ];
20 propagatedBuildInputs = [ six html5lib ];
21
22 postPatch = ''
23 substituteInPlace setup.py --replace ",<3dev" ""
24 '';
25
26 meta = {
27 description = "An easy, HTML5, whitelisting HTML sanitizer";
28 longDescription = ''
29 Bleach is an HTML sanitizing library that escapes or strips markup and
30 attributes based on a white list. Bleach can also linkify text safely,
31 applying filters that Django's urlize filter cannot, and optionally
32 setting rel attributes, even on links already in the text.
33
34 Bleach is intended for sanitizing text from untrusted sources. If you
35 find yourself jumping through hoops to allow your site administrators
36 to do lots of things, you're probably outside the use cases. Either
37 trust those users, or don't.
38 '';
39 homepage = https://github.com/mozilla/bleach;
40 downloadPage = https://github.com/mozilla/bleach/releases;
41 license = lib.licenses.asl20;
42 maintainers = with lib.maintainers; [ prikhi ];
43 };
44}