From d1683e26bc9889c08a1e2f9b02e0c73a09542140 Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 27 Jan 2025 16:32:45 +0100 Subject: [PATCH] fix title undefined (#604) * fix title undefined * urg --- packages/zudoku/src/lib/util/MdxComponents.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/zudoku/src/lib/util/MdxComponents.tsx b/packages/zudoku/src/lib/util/MdxComponents.tsx index 38051b28..924033ad 100644 --- a/packages/zudoku/src/lib/util/MdxComponents.tsx +++ b/packages/zudoku/src/lib/util/MdxComponents.tsx @@ -61,7 +61,7 @@ export const MdxComponents = { code: ({ className, children, ...props }) => { // `inline` provided by the rehype plugin, as react-markdown removed support for that // eslint-disable-next-line @typescript-eslint/no-explicit-any - const { inline, title } = props as Record; + const { inline, title } = props as Record; if (inline === true || inline === "true") { return {children}; @@ -75,7 +75,7 @@ export const MdxComponents = { className="rounded-xl p-4 border dark:!bg-foreground/10 dark:border-transparent" showLanguageIndicator code={String(children).trim()} - title={String(title) ?? undefined} + title={typeof title === "string" ? title : undefined} /> ); },