修复
This commit is contained in:
@@ -585,6 +585,9 @@ function formatMessageTime(dateStr: string | undefined) {
|
||||
|
||||
function formatMarkdown(content: string) {
|
||||
let html = content;
|
||||
// 过滤掉思考标签和data:前缀
|
||||
html = html.replace(/<\/?think>/gi, '');
|
||||
html = html.replace(/^data:/gm, '');
|
||||
html = html.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>');
|
||||
html = html.replace(/`([^`]+)`/g, '<code>$1</code>');
|
||||
html = html.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
||||
|
||||
@@ -1114,6 +1114,10 @@ function formatMarkdown(content: string) {
|
||||
// 简单的 Markdown 转换(可以使用 marked.js 等库进行更复杂的转换)
|
||||
let html = content;
|
||||
|
||||
// 过滤掉思考标签和data:前缀
|
||||
html = html.replace(/<\/?think>/gi, '');
|
||||
html = html.replace(/^data:/gm, '');
|
||||
|
||||
// 代码块
|
||||
html = html.replace(/```(\w+)?\n([\s\S]*?)```/g, '<pre><code>$2</code></pre>');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user