1
- import { Code , Flex , HStack , IconButton , Stack , Text } from '@chakra-ui/react' ;
1
+ import { Code , Flex , HStack , IconButton , Stack , Text as ChakraText , UnorderedList } from '@chakra-ui/react' ;
2
2
import 'katex/dist/katex.min.css' ;
3
3
import React , { ClassAttributes , FunctionComponent , HTMLAttributes , useState } from 'react' ;
4
4
import { FaChevronDown , FaChevronRight } from 'react-icons/fa' ;
5
5
import ReactMarkdown from 'react-markdown' ;
6
- import { CodeComponent , ReactMarkdownProps } from 'react-markdown/lib/ast-to-react' ;
6
+ import { CodeComponent , ReactMarkdownProps , UnorderedListComponent } from 'react-markdown/lib/ast-to-react' ;
7
7
import rehypeKatex from 'rehype-katex' ;
8
8
import remarkGfm from 'remark-gfm' ;
9
9
import remarkMath from 'remark-math' ;
@@ -17,16 +17,21 @@ type ParagraphComponent = FunctionComponent<
17
17
> ;
18
18
19
19
const CustomText : ParagraphComponent = function ( { className, children } ) {
20
- return < Text className = { className } > { children } </ Text > ;
20
+ return < ChakraText className = { className } > { children } </ ChakraText > ;
21
21
} ;
22
22
23
23
const CustomCode : CodeComponent = function ( { className, children } ) {
24
24
return < Code className = { className } > { children } </ Code > ;
25
25
} ;
26
26
27
+ const CustomUnorderedList : UnorderedListComponent = function ( { className, children } ) {
28
+ return < UnorderedList className = { className } > { children } </ UnorderedList > ;
29
+ } ;
30
+
27
31
const components = {
28
32
p : CustomText ,
29
33
code : CustomCode ,
34
+ ul : CustomUnorderedList ,
30
35
} ;
31
36
32
37
export const DocumentationText : React . FC < DocumentationTextProps > = function ( { inputText = '' } ) {
0 commit comments