使用openai进行了代码review
This commit is contained in:
@@ -6,6 +6,7 @@ import { cn } from "@/lib/utils";
|
||||
import { useSettingsStore } from "@/lib/settings-store";
|
||||
import { Editor } from "@tiptap/react";
|
||||
import { marked } from "marked";
|
||||
import { sanitizeHtml } from "@/lib/sanitize-html";
|
||||
|
||||
interface Message {
|
||||
id: string;
|
||||
@@ -189,7 +190,7 @@ export function AIChatPanel({ editor, isOpen, onClose }: AIChatPanelProps) {
|
||||
{msg.role === "assistant" ? (
|
||||
<div
|
||||
className="prose dark:prose-invert prose-sm max-w-none break-words [&>p]:mb-2 [&>ul]:list-disc [&>ul]:pl-4 [&>ol]:list-decimal [&>ol]:pl-4"
|
||||
dangerouslySetInnerHTML={{ __html: marked.parse(msg.content) as string }}
|
||||
dangerouslySetInnerHTML={{ __html: sanitizeHtml(marked.parse(msg.content) as string) }}
|
||||
/>
|
||||
) : (
|
||||
<p className="whitespace-pre-wrap">{msg.content}</p>
|
||||
|
||||
Reference in New Issue
Block a user