From 3c6f2839b1475a805a02c362e83ceeef333b5a3c Mon Sep 17 00:00:00 2001 From: Sarah Gerrard Date: Tue, 2 Dec 2025 07:09:26 -0800 Subject: [PATCH] add id to tab key --- src/components/Markdown.tsx | 17 ++++++++++++----- src/components/Tabs.tsx | 10 +++++++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index f6d58ae5e..f9712d1df 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -30,7 +30,10 @@ const CustomHeading = ({ // Convert children to array and strip any inner anchor (native 'a' or MarkdownLink) const childrenArray = React.Children.toArray(children) const sanitizedChildren = childrenArray.map((child) => { - if (React.isValidElement(child) && (child.type === 'a' || child.type === MarkdownLink)) { + if ( + React.isValidElement(child) && + (child.type === 'a' || child.type === MarkdownLink) + ) { // replace anchor child with its own children so outer anchor remains the only link return child.props.children ?? null } @@ -45,7 +48,10 @@ const CustomHeading = ({ if (id) { return ( - + {heading} ) @@ -55,8 +61,7 @@ const CustomHeading = ({ } const makeHeading = - (type: HeadingLevel) => - (props: HTMLProps) => + (type: HeadingLevel) => (props: HTMLProps) => ( + return ( + + ) } default: return
{domToReact(domNode.children as any, options)}
diff --git a/src/components/Tabs.tsx b/src/components/Tabs.tsx index 97324586c..53c943c95 100644 --- a/src/components/Tabs.tsx +++ b/src/components/Tabs.tsx @@ -11,9 +11,10 @@ export type TabDefinition = { export type TabsProps = { tabs: Array children: Array + id: string } -export function Tabs({ tabs, children }: TabsProps) { +export function Tabs({ tabs, id, children }: TabsProps) { const Route = getRouteApi() const { framework } = Route.useParams() @@ -27,6 +28,7 @@ export function Tabs({ tabs, children }: TabsProps) { {tabs.map((tab) => { return (