fix: hide markdown emphasis markers in chat responses
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m22s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 6m22s
This commit is contained in:
@@ -173,6 +173,10 @@
|
||||
.replace(/'/g, "'");
|
||||
}
|
||||
|
||||
function removeMarkdownEmphasis(text) {
|
||||
return text.replace(/\*\*/g, '');
|
||||
}
|
||||
|
||||
async function sendMessage() {
|
||||
const text = chatInput.value.trim();
|
||||
if (!text || isLoading) return;
|
||||
@@ -205,6 +209,7 @@
|
||||
// 5. 스트림 읽기
|
||||
const reader = response.body.getReader();
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
let responseText = '';
|
||||
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
@@ -215,7 +220,8 @@
|
||||
for (const line of lines) {
|
||||
if (line.startsWith('data:')) {
|
||||
const data = line.substring(5);
|
||||
textContainer.innerHTML += escapeHtml(data);
|
||||
responseText += data;
|
||||
textContainer.textContent = removeMarkdownEmphasis(responseText);
|
||||
scrollToBottom();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user