mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: better url pattern
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -147,7 +148,7 @@ class IntroDetail extends StatelessWidget {
|
||||
switch (currentDesc.type) {
|
||||
case 1:
|
||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||
final RegExp urlRegExp = RegExp(r'https?://\S+\b');
|
||||
final RegExp urlRegExp = RegExp(Constants.urlPattern);
|
||||
final Iterable<Match> matches =
|
||||
urlRegExp.allMatches(currentDesc.rawText);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user