fix(ui, core): make message input regex caseInsensitive.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -1042,6 +1042,7 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
|||||||
CancelableOperation? _enrichUrlOperation;
|
CancelableOperation? _enrichUrlOperation;
|
||||||
final _urlRegex = RegExp(
|
final _urlRegex = RegExp(
|
||||||
r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+',
|
r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+',
|
||||||
|
caseSensitive: false,
|
||||||
);
|
);
|
||||||
|
|
||||||
void _checkContainsUrl(String value, BuildContext context) async {
|
void _checkContainsUrl(String value, BuildContext context) async {
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ class MessageTextFieldController extends TextEditingController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return TextSpan(text: text, style: style).splitMapJoin(
|
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) {
|
onMatch: (match) {
|
||||||
final text = match[0]!;
|
final text = match[0]!;
|
||||||
final key = pattern.keys.firstWhere((it) => it.hasMatch(text));
|
final key = pattern.keys.firstWhere((it) => it.hasMatch(text));
|
||||||
|
|||||||
Reference in New Issue
Block a user