From aa287f90d225fce7326a128aa4c31010fc0db5c1 Mon Sep 17 00:00:00 2001 From: Antoine BERNIER Date: Tue, 3 Sep 2024 08:07:54 +0200 Subject: [PATCH] fix: code --- src/app/[...slug]/page.tsx | 10 +--------- src/app/globals.css | 4 ++-- src/components/mdx/index.tsx | 7 +++++++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/app/[...slug]/page.tsx b/src/app/[...slug]/page.tsx index c20d0f0f..aeb52b18 100644 --- a/src/app/[...slug]/page.tsx +++ b/src/app/[...slug]/page.tsx @@ -40,15 +40,7 @@ export default async function Page({ params }: Props) { <>
-

- {doc.sourcecode ? ( - - {doc.title} - - ) : ( - doc.title - )} -

+

{doc.title}

{!!doc?.description?.length && (

{doc.description} diff --git a/src/app/globals.css b/src/app/globals.css index 9db26a11..e2b124f9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -72,8 +72,8 @@ pre[class*='language-'] { } /* Inline code */ -:not(pre) > code { - @apply bg-surface-container-high rounded-lg px-1.5 py-0.5 font-mono text-[85%]; +:not(pre) > code[class*='language-'] { + @apply rounded-lg; white-space: normal; } diff --git a/src/components/mdx/index.tsx b/src/components/mdx/index.tsx index c79b7bde..5e75739f 100644 --- a/src/components/mdx/index.tsx +++ b/src/components/mdx/index.tsx @@ -96,6 +96,13 @@ export const a = ({ href, target, rel, ...props }: ComponentProps<'a'>) => { export const img = Img +export const code = (props: ComponentProps<'code'>) => ( + +) + export const details = (props: ComponentProps<'details'>) =>

export const summary = (props: ComponentProps<'summary'>) => (