From e069aa48dd4e36187daf814ef69806e296fc2431 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 25 Mar 2022 12:40:18 +0200 Subject: [PATCH] Fixed link matching regex. --- .../Sources/Other/HTMLParsing/AttributedStringBuilderUtils.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderUtils.m b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderUtils.m index 85f2dc194..8dd2f5b1a 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderUtils.m +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderUtils.m @@ -45,7 +45,7 @@ NSString *const kMXToolsRegexStringForMatrixGroupIdentifier = @"\\+[A-Z0-9=_ eventIdRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixEventIdentifier options:NSRegularExpressionCaseInsensitive error:nil]; groupIdRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixGroupIdentifier options:NSRegularExpressionCaseInsensitive error:nil]; - httpLinksRegex = [NSRegularExpression regularExpressionWithPattern:@"(?i)\\b(https?://.*)\\b" options:NSRegularExpressionCaseInsensitive error:nil]; + httpLinksRegex = [NSRegularExpression regularExpressionWithPattern:@"(?i)\\b(https?://\\S*)\\b" options:NSRegularExpressionCaseInsensitive error:nil]; htmlTagsRegex = [NSRegularExpression regularExpressionWithPattern:@"<(\\w+)[^>]*>" options:NSRegularExpressionCaseInsensitive error:nil]; }); }