@@ -724,29 +724,6 @@ public class NotesTextProcessor {
724724 }
725725 }
726726
727- // We detect and process inline mailto links not formatted
728- NotesTextProcessor . autolinkEmailRegex. matches ( string, range: paragraphRange) { result in
729- guard let range = result? . range else { return }
730- let substring = attributedString. mutableString. substring ( with: range)
731- guard substring. lengthOfBytes ( using: . utf8) > 0 else { return }
732-
733- attributedString. addAttribute ( . foregroundColor, value: linkColor, range: range)
734-
735- if substring. isValidEmail ( ) {
736- attributedString. addAttribute ( . link, value: " mailto: \( substring) " , range: range)
737- } else {
738- attributedString. addAttribute ( . link, value: substring, range: range)
739- }
740-
741- if NotesTextProcessor . hideSyntax {
742- NotesTextProcessor . mailtoRegex. matches ( string, range: range) { innerResult in
743- guard let innerRange = innerResult? . range else { return }
744- attributedString. addAttribute ( . font, value: hiddenFont, range: innerRange)
745- attributedString. addAttribute ( . foregroundColor, value: hiddenColor, range: innerRange)
746- }
747- }
748- }
749-
750727 NotesTextProcessor . imageInlineRegex. matches ( string, range: paragraphRange) { result in
751728 guard let range = result? . range else { return }
752729
@@ -1244,21 +1221,6 @@ public class NotesTextProcessor {
12441221
12451222 public static let autolinkPrefixRegex = MarklightRegex ( pattern: autolinkPrefixPattern, options: [ . allowCommentsAndWhitespace, . dotMatchesLineSeparators] )
12461223
1247- fileprivate static let autolinkEmailPattern = [
1248- " (?:mailto:)? " ,
1249- " ( " ,
1250- " [-. \\ w]+ " ,
1251- " \\ @ " ,
1252- " [-a-z0-9]+( \\ .[-a-z0-9]+)* \\ .[a-z]+ " ,
1253- " ) "
1254- ] . joined ( separator: " \n " )
1255-
1256- public static let autolinkEmailRegex = MarklightRegex ( pattern: autolinkEmailPattern, options: [ . allowCommentsAndWhitespace, . dotMatchesLineSeparators] )
1257-
1258- fileprivate static let mailtoPattern = " mailto: "
1259-
1260- public static let mailtoRegex = MarklightRegex ( pattern: mailtoPattern, options: [ . allowCommentsAndWhitespace, . dotMatchesLineSeparators] )
1261-
12621224 /// maximum nested depth of [] and () supported by the transform;
12631225 /// implementation detail
12641226 fileprivate static let _nestDepth = 6
0 commit comments