diff --git a/app/lib/views/schedule/schedule_detail_view.dart b/app/lib/views/schedule/schedule_detail_view.dart index a5d35fc..0e43323 100644 --- a/app/lib/views/schedule/schedule_detail_view.dart +++ b/app/lib/views/schedule/schedule_detail_view.dart @@ -499,8 +499,13 @@ class _ScheduleDetailViewState extends ConsumerState { // 본문 Padding( padding: const EdgeInsets.all(16), - child: _buildLinkedText( + child: Text( decodeHtmlEntities(schedule.content ?? schedule.title), + style: const TextStyle( + fontSize: 15, + height: 1.5, + color: AppColors.textPrimary, + ), ), ), // 이미지 @@ -686,69 +691,6 @@ class _ScheduleDetailViewState extends ConsumerState { ); } - /// 해시태그, URL을 감지해서 링크로 만드는 RichText - Widget _buildLinkedText(String text) { - // 해시태그 (#xxx) 또는 URL (https://...) 매칭 - final pattern = RegExp(r'(#[^\s#]+)|(https?://[^\s]+)'); - final spans = []; - int lastEnd = 0; - - for (final match in pattern.allMatches(text)) { - // 매치 앞의 일반 텍스트 - if (match.start > lastEnd) { - spans.add(TextSpan( - text: text.substring(lastEnd, match.start), - style: const TextStyle( - fontSize: 15, - height: 1.5, - color: AppColors.textPrimary, - ), - )); - } - - final matched = match.group(0)!; - final isHashtag = matched.startsWith('#'); - - final url = isHashtag - ? 'https://x.com/hashtag/${Uri.encodeComponent(matched.substring(1))}?src=hashtag_click' - : matched; - - spans.add(WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: GestureDetector( - onTap: () => _launchUrl(url), - child: Text( - matched, - style: TextStyle( - fontSize: 15, - height: 1.5, - color: AppColors.primary, - decoration: isHashtag ? TextDecoration.none : TextDecoration.underline, - decorationColor: AppColors.primary, - ), - ), - ), - )); - - lastEnd = match.end; - } - - // 남은 텍스트 - if (lastEnd < text.length) { - spans.add(TextSpan( - text: text.substring(lastEnd), - style: const TextStyle( - fontSize: 15, - height: 1.5, - color: AppColors.textPrimary, - ), - )); - } - - return RichText(text: TextSpan(children: spans)); - } - /// 인증 배지 Widget _buildVerifiedBadge() { return SizedBox(