fix: 모바일 일정 HTML 엔티티 디코딩 적용
- decodeHtmlEntities 함수 추가 - ScheduleCard, TimelineScheduleCard title에 적용 - & → & 등으로 올바르게 표시
This commit is contained in:
parent
d84ab36a83
commit
0521e3d0ec
1 changed files with 10 additions and 2 deletions
|
|
@ -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>
|
||||||
|
|
||||||
{/* 출처 */}
|
{/* 출처 */}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue