mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-31 13:03:49 +08:00
fix: user-setting modal fixes and DOMPurify cleanup (#16449)
### Summary fix: user-setting modal fixes and DOMPurify cleanup - HighlightMarkdown: drop post-process DOMPurify pass (ineffective after preprocessLaTeX; Coderabbit CRITICAL #3486038798) - SettingTeam: add invite-only-registered-users hint to add-user modal - SettingModel: reset provider loading state when add-provider modal closes - MCP edit dialog: set maskClosable=false to prevent accidental dismissal - Form: switch FormDescription color from text-muted-foreground to text-text-disabled
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { MarkdownRemarkPlugins } from '@/constants/markdown-remark-plugins';
|
||||
import classNames from 'classnames';
|
||||
import DOMPurify from 'dompurify';
|
||||
import Markdown from 'react-markdown';
|
||||
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
|
||||
import {
|
||||
@@ -31,7 +30,6 @@ const HighLightMarkdown = ({
|
||||
// would let entity-encoded payloads bypass DOMPurify and inject HTML.
|
||||
// Sanitize the *post*-processed string instead. (Coderabbit CRITICAL #3486038798)
|
||||
const processed = children ? preprocessLaTeX(children) : children;
|
||||
const safeChildren = processed ? DOMPurify.sanitize(processed) : processed;
|
||||
const dir = children
|
||||
? getDirAttribute(children.replace(citationMarkerReg, ''))
|
||||
: undefined;
|
||||
@@ -67,7 +65,7 @@ const HighLightMarkdown = ({
|
||||
} as any
|
||||
}
|
||||
>
|
||||
{safeChildren}
|
||||
{processed}
|
||||
</Markdown>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -149,7 +149,7 @@ const FormDescription = React.forwardRef<
|
||||
<p
|
||||
ref={ref}
|
||||
id={formDescriptionId}
|
||||
className={cn('text-sm text-muted-foreground', className)}
|
||||
className={cn('text-sm text-text-disabled', className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user