From e603942b5fae5813ace24c4df50ca728f7c6c46c Mon Sep 17 00:00:00 2001 From: orz12 Date: Sat, 27 Jan 2024 15:49:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E8=AE=BA=E5=8C=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=AD=A3=E5=88=99=E6=8B=BC=E6=8E=A5=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/reply/widgets/reply_item.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 6ecf3983..98d8ba6a 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -593,10 +593,10 @@ InlineSpan buildContent( ...content.atNameToMid.keys.map((e) => '@$e'), ...content.jumpUrl.keys.map((e) => 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); List matchedStrs = []; // 分割文本并处理每个部分 @@ -647,12 +647,15 @@ InlineSpan buildContent( ..onTap = () { // 跳转到指定位置 try { + SmartDialog.showToast('跳转至:$matchStr'); Get.find(tag: Get.arguments['heroTag']) .plPlayerController .seekTo( Duration(seconds: Utils.duration(matchStr)), ); - } catch (_) {} + } catch (e) { + SmartDialog.showToast('跳转失败: $e'); + } }, ), ); @@ -661,7 +664,9 @@ InlineSpan buildContent( String appUrlSchema = ''; final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe, 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']; spanChilds.add( TextSpan(