[fix] some urls will be misjudged to phone (#16)

This commit is contained in:
Hxphieno 2024-04-14 02:15:45 +08:00 committed by GitHub
parent 8088c99085
commit 4feb8a26c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -59,13 +59,13 @@ LinkType getMatchedType(String match) {
late LinkType type; late LinkType type;
if (RegExp(emailRegExp).hasMatch(match)) { if (RegExp(emailRegExp).hasMatch(match)) {
type = LinkType.email; type = LinkType.email;
} else if (RegExp(phoneRegExp).hasMatch(match)) { } else if (RegExp(urlRegExp).hasMatch(match)) {
type = LinkType.url;
}else if (RegExp(phoneRegExp).hasMatch(match)) {
type = LinkType.phone; type = LinkType.phone;
} else if (RegExp(userTagRegExp).hasMatch(match)) { } else if (RegExp(userTagRegExp).hasMatch(match)) {
type = LinkType.userTag; type = LinkType.userTag;
} else if (RegExp(urlRegExp).hasMatch(match)) { } else if (RegExp(hashtagRegExp).hasMatch(match)) {
type = LinkType.url;
} else if (RegExp(hashtagRegExp).hasMatch(match)) {
type = LinkType.hashTag; type = LinkType.hashTag;
} }
return type; return type;