diff --git a/website/client/templates/Documentation.tsx b/website/client/templates/Documentation.tsx index 912a6099c..5ff8281bb 100644 --- a/website/client/templates/Documentation.tsx +++ b/website/client/templates/Documentation.tsx @@ -80,8 +80,9 @@ const getAnchor = (children: any) => { const heading: string = // eslint-disable-line (children as any)?.[0]?.props?.children?.[0] ?? children?.[0] ?? ""; // eslint-disable-line - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const keepDots: boolean = children?.[0]?.type === "code"; + // Brittle and doesn't always work. + // const keepDots: boolean = children?.[0]?.type === "code"; + const keepDots: boolean = JSON.stringify(children).includes("code"); const regex = keepDots === true ? /[^.a-zA-Z0-9 ]/g : /[^a-zA-Z0-9 ]/g; const anchor = heading.toLowerCase().replace(regex, "").replace(/\s+/g, "-");