Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support table paraser #37

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-roses-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/gpt-vis': patch
---

feat: support table paraser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading