mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 08:06:48 +08:00
### What problem does this PR solve? Feat: Modify the style of the agent page bright theme #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -13,15 +13,16 @@ import remarkMath from 'remark-math';
|
||||
import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for you
|
||||
|
||||
import { preprocessLaTeX } from '@/utils/chat';
|
||||
import { useIsDarkTheme } from '../theme-provider';
|
||||
import styles from './index.less';
|
||||
|
||||
const HightLightMarkdown = ({
|
||||
children,
|
||||
dark = false,
|
||||
}: {
|
||||
children: string | null | undefined;
|
||||
dark?: boolean;
|
||||
}) => {
|
||||
const isDarkTheme = useIsDarkTheme();
|
||||
|
||||
return (
|
||||
<Markdown
|
||||
remarkPlugins={[remarkGfm, remarkMath]}
|
||||
@ -37,7 +38,7 @@ const HightLightMarkdown = ({
|
||||
{...rest}
|
||||
PreTag="div"
|
||||
language={match[1]}
|
||||
style={dark ? oneDark : oneLight}
|
||||
style={isDarkTheme ? oneDark : oneLight}
|
||||
>
|
||||
{String(children).replace(/\n$/, '')}
|
||||
</SyntaxHighlighter>
|
||||
|
||||
Reference in New Issue
Block a user