feat: AI 어시스턴트 마크다운 렌더링 및 상태 표시 개선
- marked.js 라이브러리 추가, AI 답변 마크다운 렌더링 - AI 답변 prose 스타일 적용 (제목, 목록, 굵은글씨, 인용) - health 응답 파싱 개선 (이중 중첩 구조 fallback 추가) - JS/CSS 버전 캐시 무효화 (v=20260307) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -127,7 +127,8 @@ async function checkAiHealth() {
|
||||
|
||||
const model = health.model
|
||||
|| health.llm_model
|
||||
|| (health.ollama?.models?.[0]);
|
||||
|| health.ollama?.ollama?.models?.[0]
|
||||
|| health.ollama?.models?.[0];
|
||||
if (model) {
|
||||
modelName.textContent = model;
|
||||
}
|
||||
@@ -193,8 +194,13 @@ function appendChatMessage(role, content, sources) {
|
||||
|
||||
// 내용 렌더링
|
||||
const contentDiv = document.createElement('div');
|
||||
contentDiv.className = 'text-sm whitespace-pre-line';
|
||||
contentDiv.textContent = content;
|
||||
if (role === 'ai' && typeof marked !== 'undefined') {
|
||||
contentDiv.className = 'text-sm prose prose-sm max-w-none';
|
||||
contentDiv.innerHTML = marked.parse(content);
|
||||
} else {
|
||||
contentDiv.className = 'text-sm whitespace-pre-line';
|
||||
contentDiv.textContent = content;
|
||||
}
|
||||
bubble.appendChild(contentDiv);
|
||||
|
||||
// AI 답변 참고 사례
|
||||
|
||||
Reference in New Issue
Block a user