Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(chat-input): disable automatic URL highlighting (#15219)

Inneicce2741de36a
diff --git a/src/features/ChatInput/InputEditor/index.tsx b/src/features/ChatInput/InputEditor/index.tsx
index e5be3557710..1dc1263919b 100644
--- a/src/features/ChatInput/InputEditor/index.tsx
+++ b/src/features/ChatInput/InputEditor/index.tsx
@@ -409,6 +409,7 @@ const InputEditor = memo<{
const basePlugins = !enableRichRender
? CHAT_INPUT_EMBED_PLUGINS
: createChatInputRichPlugins({
+ linkPlugin: false,
mathPlugin: Editor.withProps(ReactMathPlugin, {
renderComp: expand
? undefined
diff --git a/src/features/ChatInput/InputEditor/plugins.ts b/src/features/ChatInput/InputEditor/plugins.ts
index 09c021da35f..28fac10ceaf 100644
--- a/src/features/ChatInput/InputEditor/plugins.ts
+++ b/src/features/ChatInput/InputEditor/plugins.ts
@@ -16,7 +16,7 @@ import { ReactReferTopicPlugin } from './ReferTopic';
type EditorPlugins = NonNullable<Parameters<typeof Editor>[0]['plugins']>;
interface CreateChatInputRichPluginsOptions {
- linkPlugin?: EditorPlugins[number];
+ linkPlugin?: EditorPlugins[number] | false;
mathPlugin?: EditorPlugins[number];
}
@@ -34,7 +34,7 @@ export const createChatInputRichPlugins = ({
ReactCodePlugin,
ReactCodemirrorPlugin,
ReactHRPlugin,
- linkPlugin,
+ ...(linkPlugin ? [linkPlugin] : []),
ReactVirtualBlockPlugin,
mathPlugin,
...CHAT_INPUT_EMBED_PLUGINS,