Skip to content

Commit

Permalink
feat: support table paraser
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Nov 27, 2024
1 parent f1ba812 commit 83cf10f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"lodash": "^4.17.21",
"react-markdown": "^9.0.1",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.0",
"styled-components": "^6.0.7"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/GPTVis/Lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { memo } from 'react';
import type { Options } from 'react-markdown';
import Markdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';

export interface GPTVisLiteProps extends Options {
/** 自定义 markdown components样式 */
Expand All @@ -16,12 +17,14 @@ const GPTVisLite: React.FC<GPTVisLiteProps> = ({
children,
components,
rehypePlugins,
remarkPlugins,
...rest
}) => {
return (
<Markdown
components={components}
rehypePlugins={[rehypeRaw, ...(rehypePlugins ? rehypePlugins : [])]}
remarkPlugins={[remarkGfm, ...(remarkPlugins ? remarkPlugins : [])]}
{...rest}
>
{children}
Expand Down

0 comments on commit 83cf10f

Please sign in to comment.