diff --git a/example/linkify_example.dart b/example/linkify_example.dart index 0ed4ecc..dad79a5 100644 --- a/example/linkify_example.dart +++ b/example/linkify_example.dart @@ -1,6 +1,8 @@ import 'package:linkify/linkify.dart'; void main() { - print(linkify("Made by https://cretezy.com person@example.com")); + print(linkify( + "http://mp.weixin.qq.com/s?__biz=MjM5MTA2ODI3OA==&mid=2449972191&idx=1&sn=0bfa1d94afec30c7113c3881495906ac&chksm=b14802c6863f8bd0d603db6e92fa604c03b98399ae3ccd9fa20db1776210aac90e2165ecde68&mpshare=1&scene=23&srcid=0703HOllo8ED2Ey25CqrKWzM&sharer_sharetime=1625303541359&sharer_shareid=5a67e5ce7f5b1dcf9c5153d2b078e447#rd", + options: LinkifyOptions(humanize: false))); // Output: [TextElement: 'Made by ', UrlElement: 'https://cretezy.com' (cretezy.com), TextElement: ' ', EmailElement: 'person@example.com' (person@example.com)] } diff --git a/lib/src/url.dart b/lib/src/url.dart index 9bb6607..f250954 100644 --- a/lib/src/url.dart +++ b/lib/src/url.dart @@ -1,7 +1,7 @@ import 'package:linkify/linkify.dart'; final _urlRegex = RegExp( - r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].[^\s]*)', + r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].[\/\\\%:\?=&#@;A-Za-z0-9_.~-]*)', caseSensitive: false, dotAll: true, );