diff --git a/web/app/guides/[slug]/GuideContent.tsx b/web/app/guides/[slug]/GuideContent.tsx index 0aee350..97288c8 100644 --- a/web/app/guides/[slug]/GuideContent.tsx +++ b/web/app/guides/[slug]/GuideContent.tsx @@ -5,13 +5,19 @@ import { useState, useEffect } from "react" import CopyableCode from "@/components/CopyableCode" function processContent(content: string): React.ReactNode[] { - const parts = content.split(/(```[\s\S]*?```)/g) + const parts = content.split(/(```[\s\S]*?```|`[^`\n]+`)/g) return parts.map((part, index) => { if (part.startsWith("```") && part.endsWith("```")) { const code = part.slice(3, -3).trim() return + } else if (part.startsWith("`") && part.endsWith("`")) { + return ( + + {part.slice(1, -1)} + + ) } - return
+ return }) } @@ -25,15 +31,16 @@ export default function GuideContent({ content }: { content: string }) { return (
a]:text-blue-600 [&>a:hover]:underline + [&>strong]:font-bold [&>strong]:text-gray-900" > {processedContent}
diff --git a/web/components/CopyableCode.tsx b/web/components/CopyableCode.tsx index d043f96..9baee04 100644 --- a/web/components/CopyableCode.tsx +++ b/web/components/CopyableCode.tsx @@ -22,13 +22,13 @@ const CopyableCode: React.FC = ({ code }) => { } return ( -
-
-        {code}
+    
+
+        {code}