1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, fetchpatch 5, python 6, pygments 7}: 8 9buildPythonPackage rec { 10 pname = "markdown2"; 11 version = "2.4.3"; 12 13 # PyPI does not contain tests, so using GitHub instead. 14 src = fetchFromGitHub { 15 owner = "trentm"; 16 repo = "python-markdown2"; 17 rev = version; 18 sha256 = "sha256-zNZ7/dDZbPIwcxSLvf8u5oaAgHLrZ6kk4vXNPUuZs/4="; 19 }; 20 21 patches = [ 22 (fetchpatch { 23 name = "SNYK-PYTHON-MARKDOWN2-2606985-xss.patch"; # no CVE (yet?) 24 url = "https://github.com/trentm/python-markdown2/commit/5898fcc1090ef7cd7783fa1422cc0e53cbca9d1b.patch"; 25 sha256 = "sha256-M6kKxjHVC3O0BvDeEF4swzfpFsDO/LU9IHvfjK4hznA="; 26 }) 27 ]; 28 29 checkInputs = [ pygments ]; 30 31 checkPhase = '' 32 runHook preCheck 33 34 pushd test 35 ${python.interpreter} ./test.py -- -knownfailure 36 popd # test 37 38 runHook postCheck 39 ''; 40 41 meta = with lib; { 42 description = "A fast and complete Python implementation of Markdown"; 43 homepage = "https://github.com/trentm/python-markdown2"; 44 license = licenses.mit; 45 maintainers = with maintainers; [ hbunke ]; 46 }; 47}