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:
@@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/imageview.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
@@ -704,7 +705,7 @@ class ReplyItem extends StatelessWidget {
|
||||
if (jumpUrlKeysList.isNotEmpty) {
|
||||
patternStr += '|${jumpUrlKeysList.map(RegExp.escape).join('|')}';
|
||||
}
|
||||
patternStr += r'|https?://\S+\b';
|
||||
patternStr += '|${Constants.urlPattern}';
|
||||
final RegExp pattern = RegExp(patternStr);
|
||||
List<String> matchedStrs = [];
|
||||
void addPlainTextSpan(str) {
|
||||
@@ -896,10 +897,10 @@ class ReplyItem extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
);
|
||||
} else if (RegExp(r'https?://\S+\b').hasMatch(matchStr)) {
|
||||
} else if (RegExp(Constants.urlPattern).hasMatch(matchStr)) {
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: ' $matchStr ',
|
||||
text: matchStr,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/imageview.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
@@ -101,7 +102,6 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
);
|
||||
|
||||
Widget _buildContent(context) {
|
||||
print(replyItem.member.garbCardImage);
|
||||
return Column(
|
||||
children: [
|
||||
if (ModuleAuthorModel.showDynDecorate &&
|
||||
@@ -745,7 +745,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
if (jumpUrlKeysList.isNotEmpty) {
|
||||
patternStr += '|${jumpUrlKeysList.map(RegExp.escape).join('|')}';
|
||||
}
|
||||
patternStr += r'|https?://\S+\b';
|
||||
patternStr += '|${Constants.urlPattern}';
|
||||
final RegExp pattern = RegExp(patternStr);
|
||||
List<String> matchedStrs = [];
|
||||
void addPlainTextSpan(str) {
|
||||
@@ -934,10 +934,10 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
);
|
||||
} else if (RegExp(r'https?://\S+\b').hasMatch(matchStr)) {
|
||||
} else if (RegExp(Constants.urlPattern).hasMatch(matchStr)) {
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: ' $matchStr ',
|
||||
text: matchStr,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user