Merge pull request #1550 from GetStream/fix/message-input-regex-case

This commit is contained in:
Sahil Kumar
2023-05-15 16:33:25 +05:30
committed by GitHub
4 changed files with 12 additions and 1 deletions
@@ -4,6 +4,9 @@
- [[#1546]](https://github.com/GetStream/stream-chat-flutter/issues/1546)
Fixed `StreamMessageInputTheme.linkHighlightColor` returning null for default theme.
- [[#1548]](https://github.com/GetStream/stream-chat-flutter/issues/1548) Fixed `StreamMessageInput` urlRegex only
matching the
lowercase `http(s)|ftp`.
## 6.1.0
@@ -1042,6 +1042,7 @@ class StreamMessageInputState extends State<StreamMessageInput>
CancelableOperation? _enrichUrlOperation;
final _urlRegex = RegExp(
r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+',
caseSensitive: false,
);
void _checkContainsUrl(String value, BuildContext context) async {
@@ -1,3 +1,7 @@
## Upcoming
- Fixed `StreamMessageInputController.textPatternStyle` not matching case-insensitive patterns.
## 6.1.0
- Updated `dart` sdk environment range to support `3.0.0`.
@@ -41,7 +41,10 @@ class MessageTextFieldController extends TextEditingController {
}
return TextSpan(text: text, style: style).splitMapJoin(
RegExp(pattern.keys.map((it) => it.pattern).join('|')),
RegExp(
pattern.keys.map((it) => it.pattern).join('|'),
caseSensitive: false,
),
onMatch: (match) {
final text = match[0]!;
final key = pattern.keys.firstWhere((it) => it.hasMatch(text));