🐛 Fix link expand match markdown link

This commit is contained in:
LittleSheep 2024-08-21 10:06:05 +08:00
parent 221b97901f
commit cc1e0599aa

View File

@ -24,10 +24,7 @@ class LinkExpansion extends StatelessWidget {
@override
Widget build(BuildContext context) {
final linkRegex = RegExp(
r'(?:(?:https?|ftp):\/\/|www\.)'
r'(?:[-_a-z0-9]+\.)*(?:[-a-z0-9]+\.[-a-z0-9]+)'
r'[^\s<]*'
r'[^\s<?!.,:*_~]',
r'(?<!\()(?:(?:https?):\/\/|www\.)(?:[-_a-z0-9]+\.)*(?:[-a-z0-9]+\.[-a-z0-9]+)[^\s<]*[^\s<?!.,:*_~]',
);
final matches = linkRegex.allMatches(content);
if (matches.isEmpty) {