fix: 모바일 일정 HTML 엔티티 디코딩 적용

- decodeHtmlEntities 함수 추가
- ScheduleCard, TimelineScheduleCard title에 적용
- & → & 등으로 올바르게 표시
This commit is contained in:
caadiq 2026-01-10 10:26:21 +09:00
parent d84ab36a83
commit 0521e3d0ec

View file

@ -6,6 +6,14 @@ import { useInView } from 'react-intersection-observer';
import { useVirtualizer } from '@tanstack/react-virtual'; import { useVirtualizer } from '@tanstack/react-virtual';
import { getSchedules, getCategories, searchSchedules } from '../../../api/public/schedules'; import { getSchedules, getCategories, searchSchedules } from '../../../api/public/schedules';
// HTML
const decodeHtmlEntities = (text) => {
if (!text) return '';
const textarea = document.createElement('textarea');
textarea.innerHTML = text;
return textarea.value;
};
// //
function MobileSchedule() { function MobileSchedule() {
const [selectedDate, setSelectedDate] = useState(new Date()); const [selectedDate, setSelectedDate] = useState(new Date());
@ -570,7 +578,7 @@ function ScheduleCard({ schedule, categoryColor, categories, delay = 0 }) {
style={{ backgroundColor: categoryColor }} style={{ backgroundColor: categoryColor }}
/> />
<div className="flex-1 min-w-0"> <div className="flex-1 min-w-0">
<h3 className="font-semibold text-sm">{schedule.title}</h3> <h3 className="font-semibold text-sm">{decodeHtmlEntities(schedule.title)}</h3>
<div className="flex flex-wrap items-center gap-2 mt-1 text-xs text-gray-500"> <div className="flex flex-wrap items-center gap-2 mt-1 text-xs text-gray-500">
{schedule.time && ( {schedule.time && (
<span className="flex items-center gap-1"> <span className="flex items-center gap-1">
@ -650,7 +658,7 @@ function TimelineScheduleCard({ schedule, categoryColor, categories, delay = 0 }
{/* 제목 */} {/* 제목 */}
<h3 className="font-bold text-[15px] text-gray-800 leading-snug"> <h3 className="font-bold text-[15px] text-gray-800 leading-snug">
{schedule.title} {decodeHtmlEntities(schedule.title)}
</h3> </h3>
{/* 출처 */} {/* 출처 */}