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:
chanx
2026-06-29 16:38:23 +08:00
committed by GitHub
parent 9b726a519e
commit ca17808f12
7 changed files with 20 additions and 9 deletions

View File

@@ -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>
);

View File

@@ -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}
/>
);