mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 08:06:48 +08:00
### What problem does this PR solve? Feat: Adjust the EmbedDialog style #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import classNames from 'classnames';
|
||||
import Markdown from 'react-markdown';
|
||||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
|
||||
import rehypeKatex from 'rehype-katex';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
@ -13,8 +14,10 @@ import styles from './index.less';
|
||||
|
||||
const HightLightMarkdown = ({
|
||||
children,
|
||||
dark = false,
|
||||
}: {
|
||||
children: string | null | undefined;
|
||||
dark?: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<Markdown
|
||||
@ -31,7 +34,7 @@ const HightLightMarkdown = ({
|
||||
{...rest}
|
||||
PreTag="div"
|
||||
language={match[1]}
|
||||
// style={dark}
|
||||
style={dark && oneDark}
|
||||
>
|
||||
{String(children).replace(/\n$/, '')}
|
||||
</SyntaxHighlighter>
|
||||
|
||||
Reference in New Issue
Block a user