chore: fix doc-links with prime (')

This commit is contained in:
hsjobeki 2023-01-23 13:43:48 +01:00
parent 921d4b8370
commit b9a63521af

View File

@ -51,7 +51,8 @@ export const Preview = (props: PreviewProps) => {
const libName = category const libName = category
.match(/(?:[a-zA-Z]*)\.nix/gm)?.[0] .match(/(?:[a-zA-Z]*)\.nix/gm)?.[0]
?.replace(".nix", ""); ?.replace(".nix", "");
const libDocsRef = `https://nixos.org/manual/nixpkgs/stable/#function-library-lib.${libName}.${name}`; const sanitizedName = name.replace("'", "-prime");
const libDocsRef = `https://nixos.org/manual/nixpkgs/stable/#function-library-lib.${libName}.${sanitizedName}`;
const builtinsDocsRef = `https://nixos.org/manual/nix/stable/language/builtins.html#builtins-${name}`; const builtinsDocsRef = `https://nixos.org/manual/nix/stable/language/builtins.html#builtins-${name}`;
return ( return (
<Box <Box