fix: think content render as markdown (#4564)
* fix: think content render as markdown * chore: fix linter issue failed on CI
This commit is contained in:
parent
daa7c0ca21
commit
f8557c78d5
@ -19,7 +19,7 @@ import { useClipboard } from '@/hooks/useClipboard'
|
||||
import { getLanguageFromExtension } from '@/utils/codeLanguageExtension'
|
||||
|
||||
export const MarkdownTextMessage = memo(
|
||||
({ text, isUser }: { id: string; text: string; isUser: boolean }) => {
|
||||
({ text, isUser }: { id?: string; text: string; isUser?: boolean }) => {
|
||||
const clipboard = useClipboard({ timeout: 1000 })
|
||||
|
||||
// Escapes headings
|
||||
|
||||
@ -3,6 +3,8 @@ import React from 'react'
|
||||
import { atom, useAtom } from 'jotai'
|
||||
import { ChevronDown, ChevronUp, Loader } from 'lucide-react'
|
||||
|
||||
import { MarkdownTextMessage } from './MarkdownTextMessage'
|
||||
|
||||
interface Props {
|
||||
text: string
|
||||
status: string
|
||||
@ -48,7 +50,9 @@ const ThinkingBlock = ({ id, text, status }: Props) => {
|
||||
|
||||
{isExpanded && (
|
||||
<div className="mt-2 pl-6 text-[hsla(var(--text-secondary))]">
|
||||
{text.replace(/<\/?think>/g, '').trim()}
|
||||
<MarkdownTextMessage
|
||||
text={text.replace(/<\/?think>/g, '').trim()}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user