From 8a80e9075e47a50fc798abcd058b59acdf1631eb Mon Sep 17 00:00:00 2001 From: Joshua Croft Date: Thu, 5 Dec 2024 11:31:48 +0000 Subject: [PATCH] conditional render of link --- theme/fetch-ai-docs/mdx-components.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/theme/fetch-ai-docs/mdx-components.tsx b/theme/fetch-ai-docs/mdx-components.tsx index ae5f20e48..9a71e7400 100644 --- a/theme/fetch-ai-docs/mdx-components.tsx +++ b/theme/fetch-ai-docs/mdx-components.tsx @@ -12,6 +12,7 @@ import React from "react"; import Image from "next/image"; import LinkImage from "../../src/svgs/external-link.svg"; import { ModifiedPre } from "components/code"; + // Anchor links function HeadingLink({ tag: Tag, @@ -162,7 +163,23 @@ export const Link = ({ href = "", className, ...props }: AnchorProps) => { typeof child === "string" ? child.split("↗️")[0] : child, ); - return ( + return "↗" == splitChildren[0] ? ( + <> + + + {splitChildren} + + + + ) : ( <>