Skip to content

Commit 39db988

Browse files
committed
feat(html): special url prefix icon for email scheme
1 parent 531a198 commit 39db988

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/utils/html/html_muncher.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,17 @@ final class _Muncher with LoggerMixin {
769769
if (url.isUserSpaceUrl && !element.innerText.contains('@')) {
770770
content = Text('@', style: TextStyle(color: Theme.of(context).colorScheme.primary));
771771
} else {
772+
final IconData prefixIcon;
773+
if (url.startsWith('mailto:')) {
774+
prefixIcon = Icons.email_outlined;
775+
} else {
776+
prefixIcon = Icons.link;
777+
}
778+
772779
content = Row(
773780
mainAxisSize: MainAxisSize.min,
774781
children: [
775-
Icon(Icons.link, size: state.fontSizeStack.lastOrNull ?? 18, color: Theme.of(context).colorScheme.primary),
782+
Icon(prefixIcon, size: state.fontSizeStack.lastOrNull ?? 18, color: Theme.of(context).colorScheme.primary),
776783
const SizedBox(width: 2),
777784
],
778785
);

0 commit comments

Comments
 (0)