mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 19:23:42 +08:00
fix: 修复 markdown 换行符不解析的 Bug,修复新发布的模型 token 统计失败错误
This commit is contained in:
@@ -503,7 +503,7 @@ const connect = function (chat_id, role_id) {
|
||||
|
||||
} else {
|
||||
lineBuffer.value += data.content;
|
||||
let md = require('markdown-it')();
|
||||
const md = require('markdown-it')({breaks: true});
|
||||
const reply = chatData.value[chatData.value.length - 1]
|
||||
reply['orgContent'] = lineBuffer.value;
|
||||
reply['content'] = md.render(lineBuffer.value);
|
||||
@@ -641,7 +641,7 @@ const loadChatHistory = function (chatId) {
|
||||
return
|
||||
}
|
||||
|
||||
const md = require('markdown-it')();
|
||||
const md = require('markdown-it')({breaks: true});
|
||||
// md.use(require('markdown-it-copy')); // 代码复制功能
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].type === "prompt") {
|
||||
|
||||
Reference in New Issue
Block a user