File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/components/LanguageDocs Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11// Copyright 2023 DatabendLabs.
22import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
33import React , { FC , ReactElement , ReactNode } from "react" ;
4+ import ReactMarkdown from "react-markdown" ;
5+ import remarkGfm from "remark-gfm" ;
46interface IProps {
5- cn : ReactNode ;
6- en : ReactNode ;
7+ cn ?: string ;
8+ en ?: string ;
79}
8- const LanguageDocs : FC < IProps > = ( { cn, en } ) : ReactElement => {
10+ const LanguageDocs : FC < IProps > = ( { cn = "" , en = "" } ) : any => {
911 const {
1012 siteConfig : {
1113 customFields : { isChina } ,
1214 } ,
1315 } = useDocusaurusContext ( ) as any ;
14- return < > { isChina ? cn : en } </ > ;
16+
17+ return (
18+ < ReactMarkdown remarkPlugins = { [ remarkGfm ] } >
19+ { isChina ? cn : en }
20+ </ ReactMarkdown >
21+ ) ;
1522} ;
1623export default LanguageDocs ;
You can’t perform that action at this time.
0 commit comments