Nix: inject DOMPurify into minified marked

See ac085b8149/scripts/deps-docker/Dockerfile (L138C1-L138C81)
This commit is contained in:
Toast 2025-11-03 02:04:15 +01:00
parent 18cabd91e6
commit f8af462977

View file

@ -1,4 +1,4 @@
{ buildNpmPackage, fetchFromGitHub }:
{ buildNpmPackage, fetchFromGitHub, breakpointHook }:
buildNpmPackage rec {
pname = "marked";
version = "4.3.0";
@ -10,10 +10,23 @@ buildNpmPackage rec {
hash = "sha256-xJotgIUoZSmjgLRIgJP9134PR1GYKjVXM5jp+JpM7bg=";
};
dompurify = fetchFromGitHub {
owner = "cure53";
repo = "DOMPurify";
tag = "3.2.7";
hash = "sha256-lwBi/3uqWBa0UTPV1iKIIXDC6+Fc9uwIgs4+pRUjdPA=";
};
npmDepsHash = "sha256-omsoER0I28ZHN78X0aku2jNJApPvpqYKgfPhRbEi+HM=";
patches = [
./../../../../../scripts/deps-docker/marked.patch
./../../../../../scripts/deps-docker/marked-ln.patch
];
nativeBuildInputs = [ breakpointHook ];
postBuild = ''
# Inject DOMPurify to minified marked
cat ${dompurify}/dist/purify.min.js >> marked.min.js
'';
}