From 0c4bad406ea2b8620b131a45a059dec57e84969b Mon Sep 17 00:00:00 2001 From: orz12 Date: Sat, 27 Jan 2024 14:28:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E8=AF=84=E8=AE=BA=E5=8C=BA=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E9=80=BB=E8=BE=91=E9=87=8D=E6=9E=84=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=90=AB=E6=9C=89=E5=85=B3=E9=94=AE=E8=AF=8D=E7=9A=84?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E9=87=8D=E5=A4=8D=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/reply/widgets/reply_item.dart | 363 +++++++----------- 1 file changed, 131 insertions(+), 232 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 48518bee..6ecf3983 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -1,5 +1,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:get/get.dart'; import 'package:hive/hive.dart'; @@ -585,255 +586,153 @@ InlineSpan buildContent( if (content.message.contains('&')) { content.message = content.message.replaceAll('&', '&'); } - // 匹配表情 + print("content.jumpUrl.keys:" + content.jumpUrl.keys.toString()); + // 构建正则表达式 + final List specialTokens = [ + ...content.emote.keys, + ...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 RegExp pattern = RegExp(patternStr); + List matchedStrs = []; + // 分割文本并处理每个部分 content.message.splitMapJoin( - RegExp(r"\[.*?\]"), + pattern, onMatch: (Match match) { - final String matchStr = match[0]!; - if (content.emote.isNotEmpty && - matchStr.indexOf('[') == matchStr.lastIndexOf('[') && - matchStr.indexOf(']') == matchStr.lastIndexOf(']')) { + String matchStr = match[0]!; + if (content.emote.containsKey(matchStr)) { + // 处理表情 final int size = content.emote[matchStr]['meta']['size']; - if (content.emote.keys.contains(matchStr)) { + spanChilds.add(WidgetSpan( + child: NetworkImgLayer( + src: content.emote[matchStr]['url'], + type: 'emote', + width: size * 20, + height: size * 20, + ), + )); + } else if (matchStr.startsWith("@") && + content.atNameToMid.containsKey(matchStr.substring(1))) { + // 处理@用户 + final String userName = matchStr.substring(1); + final int userId = content.atNameToMid[userName]; + spanChilds.add( + TextSpan( + text: matchStr, + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + final String heroTag = Utils.makeHeroTag(userId); + Get.toNamed( + '/member?mid=$userId', + arguments: {'face': '', 'heroTag': heroTag}, + ); + }, + ), + ); + } else if (matchStr.contains(':')) { + spanChilds.add( + TextSpan( + text: ' $matchStr ', + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + // 跳转到指定位置 + try { + Get.find(tag: Get.arguments['heroTag']) + .plPlayerController + .seekTo( + Duration(seconds: Utils.duration(matchStr)), + ); + } catch (_) {} + }, + ), + ); + } else { + print("matchStr=$matchStr"); + String appUrlSchema = ''; + final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe, + defaultValue: false) as bool; + if (enableWordRe && content.jumpUrl[matchStr] != null && !matchedStrs.contains(matchStr)) { + appUrlSchema = content.jumpUrl[matchStr]['app_url_schema']; spanChilds.add( - WidgetSpan( - child: NetworkImgLayer( - src: content.emote[matchStr]['url'], - type: 'emote', - width: size * 20, - height: size * 20, + TextSpan( + text: content.jumpUrl[matchStr]['title'], + style: TextStyle( + color: Theme.of(context).colorScheme.primary, ), + recognizer: TapGestureRecognizer() + ..onTap = () { + if (appUrlSchema == '') { + final String str = Uri.parse(matchStr).pathSegments[0]; + final Map matchRes = IdUtils.matchAvorBv(input: str); + final List matchKeys = matchRes.keys.toList(); + if (matchKeys.isNotEmpty) { + if (matchKeys.first == 'BV') { + Get.toNamed( + '/searchResult', + parameters: {'keyword': matchRes['BV']}, + ); + } + } else { + Get.toNamed( + '/webview', + parameters: { + 'url': matchStr, + 'type': 'url', + 'pageTitle': '' + }, + ); + } + } else { + if (appUrlSchema.startsWith('bilibili://search')) { + Get.toNamed('/searchResult', parameters: { + 'keyword': content.jumpUrl[matchStr]['title'] + }); + } + } + }, ), ); + if (appUrlSchema.startsWith('bilibili://search') && enableWordRe) { + spanChilds.add( + WidgetSpan( + child: Icon( + FontAwesomeIcons.magnifyingGlass, + size: 9, + color: Theme.of(context).colorScheme.primary, + ), + alignment: PlaceholderAlignment.top, + ), + ); + } + // 只显示一次 + matchedStrs.add(matchStr); } else { spanChilds.add(TextSpan( text: matchStr, recognizer: TapGestureRecognizer() ..onTap = () => replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); - return matchStr; } - } else { - spanChilds.add(TextSpan( - text: matchStr, - recognizer: TapGestureRecognizer() - ..onTap = () => - replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); - return matchStr; } return ''; }, - onNonMatch: (String str) { - // 匹配@用户 - String matchMember = str; - if (content.atNameToMid.isNotEmpty) { - final List atNameToMidKeys = content.atNameToMid.keys.toList(); - RegExp reg = RegExp(atNameToMidKeys.map((key) => key).join('|')); - // if (!content.message.contains(':')) { - // reg = RegExp(r"@.*( |:)"); - // } - - // 只@用户没有内容 - if (!content.message.contains(':') || - (content.atNameToMid.length == 1 && - content.message == '@${content.members.first.uname}')) { - reg = RegExp(r"@.*( |:|$)"); - } - matchMember = str.splitMapJoin( - reg, - onMatch: (Match match) { - if (match[0] != null) { - hasMatchMember = true; - content.atNameToMid.forEach((key, value) { - if (str.contains('回复')) { - spanChilds.add( - TextSpan( - text: '回复 ', - style: TextStyle( - fontSize: - Theme.of(context).textTheme.titleSmall!.fontSize, - ), - ), - ); - } - spanChilds.add( - TextSpan( - text: '@$key', - style: TextStyle( - fontSize: - Theme.of(context).textTheme.titleSmall!.fontSize, - color: Theme.of(context).colorScheme.primary, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - final String heroTag = Utils.makeHeroTag(value); - Get.toNamed( - '/member?mid=$value', - arguments: {'face': '', 'heroTag': heroTag}, - ); - }, - ), - ); - }); - } - return ''; - }, - onNonMatch: (String str) { - if (!str.contains('@')) { - spanChilds.add(TextSpan(text: str)); - } - print(str); - return str; - }, - ); - } else { - matchMember = str; - } - - // 匹配 jumpUrl - String matchUrl = matchMember; - if (content.jumpUrl.isNotEmpty) { - final List urlKeys = content.jumpUrl.keys.toList().reversed.toList(); - for (int index = 0; index < urlKeys.length; index++) { - var i = urlKeys[index]; - if (i.contains('?')) { - urlKeys[index] = i.replaceAll('?', '\\?'); - } - if (i.contains('+')) { - urlKeys[index] = i.replaceAll('+', '\\+'); - } - if (i.contains('*')) { - urlKeys[index] = i.replaceAll('*', '\\*'); - } - } - if (hasMatchMember) { - matchMember = matchMember.split('回复 @ :').length > 1 - ? matchMember.split('回复 @ :')[1] - : matchMember; - } - matchUrl = matchMember.splitMapJoin( - /// RegExp.escape() 转义特殊字符 - RegExp(urlKeys.map((key) => key).join("|")), - // RegExp('What does the fox say\\?'), - onMatch: (Match match) { - final String matchStr = match[0]!; - String appUrlSchema = ''; - if (content.jumpUrl[matchStr] != null) { - appUrlSchema = content.jumpUrl[matchStr]['app_url_schema']; - } - // 默认不显示关键词 - final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe, - defaultValue: false) as bool; - if (content.jumpUrl[matchStr] != null) { - spanChilds.add( - TextSpan( - text: content.jumpUrl[matchStr]['title'], - style: TextStyle( - color: enableWordRe - ? Theme.of(context).colorScheme.primary - : null, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - if (appUrlSchema == '') { - final String str = Uri.parse(matchStr).pathSegments[0]; - final Map matchRes = IdUtils.matchAvorBv(input: str); - final List matchKeys = matchRes.keys.toList(); - if (matchKeys.isNotEmpty) { - if (matchKeys.first == 'BV') { - Get.toNamed( - '/searchResult', - parameters: {'keyword': matchRes['BV']}, - ); - } - } else { - Get.toNamed( - '/webview', - parameters: { - 'url': matchStr, - 'type': 'url', - 'pageTitle': '' - }, - ); - } - } else { - if (appUrlSchema.startsWith('bilibili://search') && - enableWordRe) { - Get.toNamed('/searchResult', parameters: { - 'keyword': content.jumpUrl[matchStr]['title'] - }); - } - } - }, - ), - ); - } - - if (appUrlSchema.startsWith('bilibili://search') && enableWordRe) { - spanChilds.add( - WidgetSpan( - child: Icon( - FontAwesomeIcons.magnifyingGlass, - size: 9, - color: Theme.of(context).colorScheme.primary, - ), - alignment: PlaceholderAlignment.top, - ), - ); - } - return ''; - }, - onNonMatch: (String str) { - spanChilds.add(TextSpan( - text: str, - recognizer: TapGestureRecognizer() - ..onTap = () => replyReply( - replyItem.root == 0 ? replyItem : fReplyItem))); - return str; - }, - ); - } - str = matchUrl.splitMapJoin( - RegExp(r'\b\d{2}:\d{2}\b'), - onMatch: (Match match) { - String matchStr = match[0]!; - spanChilds.add( - TextSpan( - text: ' $matchStr ', - style: TextStyle( - color: Theme.of(context).colorScheme.primary, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - // 跳转到指定位置 - try { - Get.find( - tag: Get.arguments['heroTag']) - .plPlayerController - .seekTo( - Duration(seconds: Utils.duration(matchStr)), - ); - } catch (_) {} - }, - ), - ); - return ''; - }, - onNonMatch: (str) { - return str; - }, - ); - - if (content.atNameToMid.isEmpty && content.jumpUrl.isEmpty) { - if (str != '') { - spanChilds.add(TextSpan( - text: str, - recognizer: TapGestureRecognizer() - ..onTap = () => - replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); - } - } - return str; + onNonMatch: (String nonMatchStr) { + spanChilds.add(TextSpan( + text: nonMatchStr, + recognizer: TapGestureRecognizer() + ..onTap = () => + replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); + return nonMatchStr; }, ); From e603942b5fae5813ace24c4df50ca728f7c6c46c Mon Sep 17 00:00:00 2001 From: orz12 Date: Sat, 27 Jan 2024 15:49:34 +0800 Subject: [PATCH 2/6] =?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( From 85a59e11b961de26d781308619b3386619439507 Mon Sep 17 00:00:00 2001 From: orz12 Date: Thu, 1 Feb 2024 22:56:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E6=97=B6=E6=97=A0=E6=B3=95=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=97=B6=E9=97=B4=E3=80=81=E4=BF=AE=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=85=B3=E9=94=AE=E8=AF=8D=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E8=B6=85=E9=93=BE=E6=8E=A5=E3=80=81=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=B7=BB=E5=8A=A0=E4=B8=AD=E6=96=87=E5=86=92=E5=8F=B7?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=B9=B6=E6=8F=90=E5=8D=87=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=88=A4=E5=AE=9A=E4=B8=A5=E6=A0=BC=E7=A8=8B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/reply/widgets/reply_item.dart | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 98d8ba6a..cab9d420 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -595,10 +595,21 @@ InlineSpan buildContent( e.replaceAll('?', '\\?').replaceAll('+', '\\+').replaceAll('*', '\\*')), ]; - final String patternStr = - specialTokens.map(RegExp.escape).join('|') + r'|\b[0-9]{1,2}:[0-9]{2}\b'; + String patternStr = + specialTokens.map(RegExp.escape).join('|'); + if (patternStr.isNotEmpty) { + patternStr += "|"; + } + patternStr += r'(\b\d{1,2}[::]\d{2}\b)'; final RegExp pattern = RegExp(patternStr); List matchedStrs = []; + void addPlainTextSpan(str){ + spanChilds.add(TextSpan( + text: str, + recognizer: TapGestureRecognizer() + ..onTap = () => + replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); + } // 分割文本并处理每个部分 content.message.splitMapJoin( pattern, @@ -636,7 +647,7 @@ InlineSpan buildContent( }, ), ); - } else if (matchStr.contains(':')) { + } else if (RegExp(r'^\b[0-9]{1,2}[::][0-9]{2}\b$').hasMatch(matchStr)) { spanChilds.add( TextSpan( text: ' $matchStr ', @@ -647,6 +658,7 @@ InlineSpan buildContent( ..onTap = () { // 跳转到指定位置 try { + matchStr = matchStr.replaceAll(':', ':'); SmartDialog.showToast('跳转至:$matchStr'); Get.find(tag: Get.arguments['heroTag']) .plPlayerController @@ -664,10 +676,13 @@ InlineSpan buildContent( String appUrlSchema = ''; final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe, defaultValue: false) as bool; - if (enableWordRe && - content.jumpUrl[matchStr] != null && + if (content.jumpUrl[matchStr] != null && !matchedStrs.contains(matchStr)) { appUrlSchema = content.jumpUrl[matchStr]['app_url_schema']; + if (appUrlSchema.startsWith('bilibili://search') && !enableWordRe) { + addPlainTextSpan(matchStr); + return ""; + } spanChilds.add( TextSpan( text: content.jumpUrl[matchStr]['title'], @@ -707,7 +722,7 @@ InlineSpan buildContent( }, ), ); - if (appUrlSchema.startsWith('bilibili://search') && enableWordRe) { + if (appUrlSchema.startsWith('bilibili://search')) { spanChilds.add( WidgetSpan( child: Icon( @@ -722,21 +737,13 @@ InlineSpan buildContent( // 只显示一次 matchedStrs.add(matchStr); } else { - spanChilds.add(TextSpan( - text: matchStr, - recognizer: TapGestureRecognizer() - ..onTap = () => - replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); + addPlainTextSpan(matchStr); } } return ''; }, onNonMatch: (String nonMatchStr) { - spanChilds.add(TextSpan( - text: nonMatchStr, - recognizer: TapGestureRecognizer() - ..onTap = () => - replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); + addPlainTextSpan(nonMatchStr); return nonMatchStr; }, ); From 81371c5a31538425af93c020943cc0782b92da4d Mon Sep 17 00:00:00 2001 From: orz12 Date: Fri, 2 Feb 2024 00:06:46 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=E5=8F=AA=E6=9C=89=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E8=AF=84=E8=AE=BA=E5=8C=BA=E4=B8=8D=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/reply/widgets/reply_item.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index cab9d420..48503d30 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -544,7 +544,9 @@ InlineSpan buildContent( content.atNameToMid.isEmpty && content.jumpUrl.isEmpty && content.vote.isEmpty && - content.pictures.isEmpty) { + content.pictures.isEmpty && + content.message.isNotEmpty && + !RegExp(r'\b[0-9]{1,2}[::][0-9]{2}\b').hasMatch(content.message)) { return TextSpan( text: content.message, recognizer: TapGestureRecognizer() From 0b349e102ebf77467205d4f298b9cef6b81f250e Mon Sep 17 00:00:00 2001 From: orz12 Date: Fri, 2 Feb 2024 00:34:52 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix=EF=BC=9A=E8=AF=84=E8=AE=BA=E5=8C=BAHTML?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E8=BD=AC=E4=B9=89=EF=BC=9B=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9F=AD=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/reply/widgets/reply_item.dart | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 48503d30..2867474e 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -540,20 +540,6 @@ InlineSpan buildContent( // replyReply 查看二楼回复(回复详情)回调 // fReplyItem 父级回复内容,用作二楼回复(回复详情)展示 final content = replyItem.content; - if (content.emote.isEmpty && - content.atNameToMid.isEmpty && - content.jumpUrl.isEmpty && - content.vote.isEmpty && - content.pictures.isEmpty && - content.message.isNotEmpty && - !RegExp(r'\b[0-9]{1,2}[::][0-9]{2}\b').hasMatch(content.message)) { - return TextSpan( - text: content.message, - recognizer: TapGestureRecognizer() - ..onTap = - () => replyReply(replyItem.root == 0 ? replyItem : fReplyItem), - ); - } final List spanChilds = []; bool hasMatchMember = false; @@ -585,10 +571,13 @@ InlineSpan buildContent( }); } // content.message = content.message.replaceAll(RegExp(r"\{vote:.*?\}"), ' '); - if (content.message.contains('&')) { - content.message = content.message.replaceAll('&', '&'); - } - print("content.jumpUrl.keys:" + content.jumpUrl.keys.toString()); + content.message = content.message.replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('"', '"') + .replaceAll(''', "'") + .replaceAll(' ', ' '); + // print("content.jumpUrl.keys:" + content.jumpUrl.keys.toString()); // 构建正则表达式 final List specialTokens = [ ...content.emote.keys, @@ -674,7 +663,7 @@ InlineSpan buildContent( ), ); } else { - print("matchStr=$matchStr"); + // print("matchStr=$matchStr"); String appUrlSchema = ''; final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe, defaultValue: false) as bool; From 5b1022628cd0d2c208da1c1db10e2bdfe9c6a053 Mon Sep 17 00:00:00 2001 From: orz12 Date: Fri, 2 Feb 2024 02:34:14 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E4=B9=9D=E5=9B=BE=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/reply/widgets/reply_item.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 2867474e..5e5a5828 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -743,10 +743,10 @@ InlineSpan buildContent( if (content.pictures.isNotEmpty) { final List picList = []; final int len = content.pictures.length; + spanChilds.add(const TextSpan(text: '\n')); if (len == 1) { Map pictureItem = content.pictures.first; picList.add(pictureItem['img_src']); - spanChilds.add(const TextSpan(text: '\n')); spanChilds.add( WidgetSpan( child: LayoutBuilder(