Skip to content

Commit

Permalink
fix title undefined (#604)
Browse files Browse the repository at this point in the history
* fix title undefined

* urg
  • Loading branch information
mosch authored Jan 27, 2025
1 parent 83301ab commit d1683e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/zudoku/src/lib/util/MdxComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string | boolean>;
const { inline, title } = props as Record<string, unknown>;

if (inline === true || inline === "true") {
return <InlineCode className={className}>{children}</InlineCode>;
Expand All @@ -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}
/>
);
},
Expand Down

0 comments on commit d1683e2

Please sign in to comment.