From d5969b6d08c8c9dd19b7929a6d4b377cc9fe2de6 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:15:27 +0100 Subject: [PATCH] Update page.tsx --- web/app/guides/[slug]/page.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/app/guides/[slug]/page.tsx b/web/app/guides/[slug]/page.tsx index d343d3a..fb77986 100644 --- a/web/app/guides/[slug]/page.tsx +++ b/web/app/guides/[slug]/page.tsx @@ -21,12 +21,22 @@ export async function generateStaticParams() { export default async function GuidePage({ params }: { params: { slug: string } }) { const guideContent = await getGuideContent(params.slug) + + const wrapCodeBlocks = (content: string) => { + return content.replace( + /
([\s\S]*?)<\/code><\/pre>/g,
+ (match, code) => ` `,
+ )
+ }
+
+ const wrappedContent = wrapCodeBlocks(guideContent)
+
return (