diff --git a/resources/views/daily-logs/index.blade.php b/resources/views/daily-logs/index.blade.php index 4940cbb5..158bb163 100644 --- a/resources/views/daily-logs/index.blade.php +++ b/resources/views/daily-logs/index.blade.php @@ -188,6 +188,19 @@ class="bg-white rounded-lg shadow-sm overflow-hidden"> // 담당자 데이터 const assignees = @json($assignees); + // HTML 이스케이프 및 줄바꿈 처리 헬퍼 + function escapeHtml(text) { + if (!text) return ''; + const div = document.createElement('div'); + div.textContent = text; + return div.innerHTML; + } + + function nl2br(text) { + if (!text) return ''; + return escapeHtml(text).replace(/\n/g, '
'); + } + // 폼 제출 시 HTMX 이벤트 트리거 document.getElementById('filterForm').addEventListener('submit', function(e) { e.preventDefault(); @@ -575,7 +588,7 @@ function renderTableAccordionContent(logId, log) { ${entry.assignee_name} ${statusLabels[entry.status]} -

${entry.content}

+

${nl2br(entry.content)}

${entry.status !== 'todo' ? ` @@ -602,7 +615,7 @@ function renderTableAccordionContent(logId, log) { contentDiv.innerHTML = `
- ${log.summary ? `
${log.summary}
` : ''} + ${log.summary ? `
${nl2br(log.summary)}
` : ''}
${entriesHtml}