Skip to content

Commit

Permalink
Merge pull request guozhigq#536 from KoolShow/fix_seekto_regexp
Browse files Browse the repository at this point in the history
fix: 含有小时的时间无法跳转
  • Loading branch information
guozhigq authored Feb 12, 2024
2 parents 0812b83 + 19b8457 commit 5692775
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pages/video/detail/reply/widgets/reply_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ InlineSpan buildContent(
if (patternStr.isNotEmpty) {
patternStr += "|";
}
patternStr += r'(\b\d{1,2}[::]\d{2}(?:[::]\d{2})?\b)';
patternStr += r'(\b(?:\d+[::])?[0-5]?[0-9][::][0-5]?[0-9]\b)';
final RegExp pattern = RegExp(patternStr);
List<String> matchedStrs = [];
void addPlainTextSpan(str) {
Expand Down Expand Up @@ -636,8 +636,8 @@ InlineSpan buildContent(
},
),
);
} else if (RegExp(r'^\b\d{1,2}[::]\d{2}(?:[::]\d{2})?\b$')
.hasMatch(matchStr)) {

} else if (RegExp(r'^\b(?:\d+[::])?[0-5]?[0-9][::][0-5]?[0-9]\b$').hasMatch(matchStr)) {
matchStr = matchStr.replaceAll(':', ':');
spanChilds.add(
TextSpan(
Expand Down

0 comments on commit 5692775

Please sign in to comment.