* format ai message content.
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
gap: 16px;
|
||||
padding: 20px 20px 0 20px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.message {
|
||||
@@ -112,6 +113,10 @@
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
pre.message-content {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.ai-message-content {
|
||||
background: #ECF4FF;
|
||||
}
|
||||
|
||||
@@ -333,7 +333,8 @@ function createMessageTime(time)
|
||||
*/
|
||||
function createMessageContent(role, content)
|
||||
{
|
||||
return $(`<div class="message-content ${role}-message-content">${content}</div>`);
|
||||
content = content.replace(/\n{2,}/g, '\n');
|
||||
return $(`<pre class="message-content ${role}-message-content">${content}</pre>`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user