fix: 评论区时间正则拼接顺序
This commit is contained in:
@ -593,10 +593,10 @@ InlineSpan buildContent(
|
|||||||
...content.atNameToMid.keys.map((e) => '@$e'),
|
...content.atNameToMid.keys.map((e) => '@$e'),
|
||||||
...content.jumpUrl.keys.map((e) =>
|
...content.jumpUrl.keys.map((e) =>
|
||||||
e.replaceAll('?', '\\?').replaceAll('+', '\\+').replaceAll('*', '\\*')),
|
e.replaceAll('?', '\\?').replaceAll('+', '\\+').replaceAll('*', '\\*')),
|
||||||
r'\b\d{2}:\d{2}\b'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
final String patternStr = specialTokens.map(RegExp.escape).join('|');
|
final String patternStr =
|
||||||
|
specialTokens.map(RegExp.escape).join('|') + r'|\b[0-9]{1,2}:[0-9]{2}\b';
|
||||||
final RegExp pattern = RegExp(patternStr);
|
final RegExp pattern = RegExp(patternStr);
|
||||||
List<String> matchedStrs = [];
|
List<String> matchedStrs = [];
|
||||||
// 分割文本并处理每个部分
|
// 分割文本并处理每个部分
|
||||||
@ -647,12 +647,15 @@ InlineSpan buildContent(
|
|||||||
..onTap = () {
|
..onTap = () {
|
||||||
// 跳转到指定位置
|
// 跳转到指定位置
|
||||||
try {
|
try {
|
||||||
|
SmartDialog.showToast('跳转至:$matchStr');
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag'])
|
Get.find<VideoDetailController>(tag: Get.arguments['heroTag'])
|
||||||
.plPlayerController
|
.plPlayerController
|
||||||
.seekTo(
|
.seekTo(
|
||||||
Duration(seconds: Utils.duration(matchStr)),
|
Duration(seconds: Utils.duration(matchStr)),
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (e) {
|
||||||
|
SmartDialog.showToast('跳转失败: $e');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -661,7 +664,9 @@ InlineSpan buildContent(
|
|||||||
String appUrlSchema = '';
|
String appUrlSchema = '';
|
||||||
final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe,
|
final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe,
|
||||||
defaultValue: false) as bool;
|
defaultValue: false) as bool;
|
||||||
if (enableWordRe && content.jumpUrl[matchStr] != null && !matchedStrs.contains(matchStr)) {
|
if (enableWordRe &&
|
||||||
|
content.jumpUrl[matchStr] != null &&
|
||||||
|
!matchedStrs.contains(matchStr)) {
|
||||||
appUrlSchema = content.jumpUrl[matchStr]['app_url_schema'];
|
appUrlSchema = content.jumpUrl[matchStr]['app_url_schema'];
|
||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
|
|||||||
Reference in New Issue
Block a user