opt: better url pattern

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-13 21:33:52 +08:00
parent 84cc65489f
commit 7dd47736fb
6 changed files with 19 additions and 11 deletions

View File

@@ -1002,8 +1002,10 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
switch (currentDesc.type) {
case 1:
final List<InlineSpan> spanChildren = <InlineSpan>[];
final RegExp urlRegExp =
RegExp(r'https?://\S+\b|av\d+|bv\S+\b', caseSensitive: false);
final RegExp urlRegExp = RegExp(
'${Constants.urlPattern}|av\\d+|bv\\S+\\b',
caseSensitive: false,
);
(currentDesc.rawText as String).splitMapJoin(
urlRegExp,