revert(app): X 게시글 해시태그 하이라이트 제거

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
caadiq 2026-03-29 14:17:18 +09:00
parent 1f3c2f3d9b
commit fc38678fbd

View file

@ -499,8 +499,13 @@ class _ScheduleDetailViewState extends ConsumerState<ScheduleDetailView> {
//
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<ScheduleDetailView> {
);
}
/// , URL을 RichText
Widget _buildLinkedText(String text) {
// (#xxx) URL (https://...)
final pattern = RegExp(r'(#[^\s#]+)|(https?://[^\s]+)');
final spans = <InlineSpan>[];
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(