From b9a63521afb51270601d8794ab49a560a518e52c Mon Sep 17 00:00:00 2001 From: hsjobeki Date: Mon, 23 Jan 2023 13:43:48 +0100 Subject: [PATCH] chore: fix doc-links with prime (') --- components/preview/preview.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/preview/preview.tsx b/components/preview/preview.tsx index b80cc1f..330f4c8 100644 --- a/components/preview/preview.tsx +++ b/components/preview/preview.tsx @@ -51,7 +51,8 @@ export const Preview = (props: PreviewProps) => { const libName = category .match(/(?:[a-zA-Z]*)\.nix/gm)?.[0] ?.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}`; return (