fix(mailer): don't add mailto: to string starting with @

This commit is contained in:
Hivert Quentin
2025-09-24 09:18:08 +02:00
parent 8d8ef5fd67
commit 981748754a
+3
View File
@@ -184,6 +184,9 @@ static int cssEscapingCount;
{
rangePtr->location += offset;
urlText = [selfCopy substringFromRange: *rangePtr];
//If we try to detect mail, check if the first char is @, meaning this is not an email
if([prefix isEqualToString: @"mailto:"] && [urlText characterAtIndex: 0] == '@')
continue;
newUrlText = [NSString stringWithFormat: @"<a rel=\"noopener\" href=\"%@%@\">%@</a>",
([urlText hasPrefix: prefix]? @"" : prefix),
urlText, urlText];