diff --git a/docs/package.json b/docs/package.json index bc03c0d31..748154968 100644 --- a/docs/package.json +++ b/docs/package.json @@ -39,7 +39,6 @@ "react-medium-image-zoom": "^5.3.0", "react-router": "^7.9.4", "react-syntax-highlighter": "^15.6.1", - "rehype-highlight": "^7.0.2", "remark-gfm": "^4.0.1", "shared": "workspace:*", "tailwindcss": "^4.1.11", @@ -56,4 +55,4 @@ "typescript": "^5.8.3", "vite": "^7.0.5" } -} +} \ No newline at end of file diff --git a/docs/src/components/MdxComponents.tsx b/docs/src/components/MdxComponents.tsx index 6fd8e7905..fcc91921f 100644 --- a/docs/src/components/MdxComponents.tsx +++ b/docs/src/components/MdxComponents.tsx @@ -4,10 +4,12 @@ import type { MDXComponents } from 'mdx/types' import Zoom from 'react-medium-image-zoom' import { Link } from 'shared' +import Code from './Code' + const HashIcon = ({ className }: { className?: string }) => ( ) }, - code() { - return ( -
- USE CUSTOM COMPONENT FOR CODE SNIPPET -
- ) + code(properties) { + if (properties.className) { + return ( + + {properties.children as string} + + ) + } + + return {properties.children} }, table(properties) { return ( diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 42a2e03fa..996abafe7 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -1,4 +1,4 @@ -import mdx from '@mdx-js/rollup' +import mdx, { Options } from '@mdx-js/rollup' import tailwindcss from '@tailwindcss/vite' import react from '@vitejs/plugin-react' import path from 'node:path' @@ -6,9 +6,8 @@ import rehypeHighlight from 'rehype-highlight' import remarkGfm from 'remark-gfm' import { defineConfig } from 'vite' -const options = { - remarkPlugins: [remarkGfm], - rehypePlugins: [rehypeHighlight] +const options: Options = { + remarkPlugins: [remarkGfm] } // https://vitejs.dev/config/