Fix confirmation for RTL overridden links

This commit is contained in:
ismailgulek
2022-05-26 17:48:39 +03:00
parent 764742fd72
commit 4a0c31ce89
2 changed files with 47 additions and 18 deletions
@@ -18,6 +18,11 @@ import Foundation
import MatrixSDK.MXLog
public extension NSString {
private enum Constants {
static let RTLOverrideChar: String = "\u{202E}"
}
/// Gets the first URL contained in the string ignoring any links to hosts defined in
/// the `firstURLDetectionIgnoredHosts` property of `MXKAppSettings`.
/// - Returns: A URL if detected, otherwise nil.
@@ -63,4 +68,14 @@ public extension NSString {
return detectedURL
}
/// Returns if the string contains an RTL override character
@objc func mxk_containsRTLOverride() -> Bool {
return contains(Constants.RTLOverrideChar)
}
/// Returns a new string which is reversed of the receiver
@objc func mxk_reversed() -> NSString {
return String((self as String).reversed()) as NSString
}
}