fix(AgentMessageComponent): 修复未处理消息内容前后空格的问题

This commit is contained in:
Wenjie Zhang 2025-08-25 23:21:49 +08:00
parent 53b8710a78
commit a7a2832e55

View File

@ -17,7 +17,6 @@
</div>
<!-- 消息内容 -->
<!-- <div v-else-if="message.content" v-html="renderMarkdown(message)" class="message-md"></div> -->
<MdPreview v-if="parsedData.content" ref="editorRef"
editorId="preview-only"
previewTheme="github"
@ -146,7 +145,7 @@ const getToolNameByToolCall = (toolCall) => {
const parsedData = computed(() => {
// Start with default values from the prop to avoid mutation.
let content = props.message.content || '';
let content = props.message.content.trim() || '';
let reasoning_content = props.message.additional_kwargs?.reasoning_content || '';
// Regex to find <think>...</think> or an unclosed <think>... at the end of the string.