MarkdownContext.tsx 479 B

123456789101112131415
  1. import markdownComponents from '@/components/chat/chat-content/config';
  2. import { GPTVis } from '@antv/gpt-vis';
  3. import React from 'react';
  4. import rehypeRaw from 'rehype-raw';
  5. import remarkGfm from 'remark-gfm';
  6. const MarkDownContext: React.FC<{ children: string }> = ({ children }) => {
  7. return (
  8. <GPTVis components={{ ...markdownComponents }} rehypePlugins={[rehypeRaw]} remarkPlugins={[remarkGfm]}>
  9. {children}
  10. </GPTVis>
  11. );
  12. };
  13. export default MarkDownContext;