1
1
import { useState , useEffect } from 'react' ;
2
2
import { useParams , Navigate } from 'react-router-dom' ;
3
3
import ReactMarkdown from 'react-markdown' ;
4
+ import remarkGfm from 'remark-gfm'
4
5
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' ;
5
6
import { tomorrow } from 'react-syntax-highlighter/dist/esm/styles/prism' ;
6
7
import DocSidebar from '../components/DocSidebar' ;
@@ -49,8 +50,9 @@ export default function Documentation() {
49
50
< div className = "max-w-4xl mx-auto" >
50
51
< article className = "prose dark:prose-invert prose-lg max-w-none" >
51
52
< ReactMarkdown
53
+ remarkPlugins = { [ remarkGfm ] }
52
54
components = { {
53
- code ( { inline, className, children, ...props } ) {
55
+ code ( { inline, className, children, ...props } ) {
54
56
const match = / l a n g u a g e - ( \w + ) / . exec ( className || '' ) ;
55
57
return ! inline && match ? (
56
58
< SyntaxHighlighter
@@ -75,11 +77,12 @@ export default function Documentation() {
75
77
ul : ( props ) => < ul className = "list-disc pl-6 mb-4 text-gray-700 dark:text-gray-300" { ...props } /> ,
76
78
ol : ( props ) => < ol className = "list-decimal pl-6 mb-4 text-gray-700 dark:text-gray-300" { ...props } /> ,
77
79
a : ( props ) => (
78
- < a
80
+ < a
79
81
className = "text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300"
80
82
{ ...props }
81
83
/>
82
84
) ,
85
+ table : ( props ) => < table className = "table-auto w-auto text-gray-700 dark:text-gray-300" { ...props } /> ,
83
86
} }
84
87
>
85
88
{ content }
0 commit comments