mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 评论区优先匹配更长的正则
避免【@植物大战僵尸 @植物大战僵尸2】同时出现时只识别到前者
This commit is contained in:
@@ -575,7 +575,7 @@ InlineSpan buildContent(
|
||||
return e.replaceAllMapped(
|
||||
RegExp(r'[?+*]'), (match) => '\\${match.group(0)}');
|
||||
}).toList();
|
||||
|
||||
specialTokens.sort((a, b) => b.length.compareTo(a.length));
|
||||
String patternStr = specialTokens.map(RegExp.escape).join('|');
|
||||
if (patternStr.isNotEmpty) {
|
||||
patternStr += "|";
|
||||
|
||||
Reference in New Issue
Block a user