mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Removing Dead Code part 1 (#2234)
This commit is contained in:
@@ -22,7 +22,6 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
private let cacheKey: String
|
||||
private let temporaryBlockquoteMarkingColor = UIColor.magenta
|
||||
private let temporaryCodeBlockMarkingColor = UIColor.cyan
|
||||
private let linkColor = UIColor.blue
|
||||
private let permalinkBaseURL: URL
|
||||
private let mentionBuilder: MentionBuilderProtocol
|
||||
|
||||
@@ -33,10 +32,6 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
caches.removeAll()
|
||||
}
|
||||
|
||||
static func invalidateCache(for key: String = defaultKey) {
|
||||
caches[key]?.removeAllValues()
|
||||
}
|
||||
|
||||
init(cacheKey: String = defaultKey, permalinkBaseURL: URL, mentionBuilder: MentionBuilderProtocol) {
|
||||
self.cacheKey = cacheKey
|
||||
if Self.caches[cacheKey] == nil {
|
||||
@@ -73,7 +68,7 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
// that could happen with the default HTML renderer of NSAttributedString which is a
|
||||
// webview.
|
||||
func fromHTML(_ htmlString: String?) -> AttributedString? {
|
||||
guard var originalHTMLString = htmlString else {
|
||||
guard let originalHTMLString = htmlString else {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -18,27 +18,27 @@ import Foundation
|
||||
|
||||
enum BlockquoteAttribute: AttributedStringKey {
|
||||
typealias Value = Bool
|
||||
public static var name = "MXBlockquoteAttribute"
|
||||
static var name = "MXBlockquoteAttribute"
|
||||
}
|
||||
|
||||
enum UserIDAttribute: AttributedStringKey {
|
||||
typealias Value = String
|
||||
public static var name = "MXUserIDAttribute"
|
||||
static var name = "MXUserIDAttribute"
|
||||
}
|
||||
|
||||
enum RoomIDAttribute: AttributedStringKey {
|
||||
typealias Value = String
|
||||
public static var name = "MXRoomIDAttribute"
|
||||
static var name = "MXRoomIDAttribute"
|
||||
}
|
||||
|
||||
enum RoomAliasAttribute: AttributedStringKey {
|
||||
typealias Value = String
|
||||
public static var name = "MXRoomAliasAttribute"
|
||||
static var name = "MXRoomAliasAttribute"
|
||||
}
|
||||
|
||||
enum AllUsersMentionAttribute: AttributedStringKey {
|
||||
typealias Value = Bool
|
||||
public static var name = "MXAllUsersMentionAttribute"
|
||||
static var name = "MXAllUsersMentionAttribute"
|
||||
}
|
||||
|
||||
struct EventIDAttributeValue: Hashable {
|
||||
@@ -48,9 +48,10 @@ struct EventIDAttributeValue: Hashable {
|
||||
|
||||
enum EventIDAttribute: AttributedStringKey {
|
||||
typealias Value = EventIDAttributeValue
|
||||
public static var name = "MXEventIDAttribute"
|
||||
static var name = "MXEventIDAttribute"
|
||||
}
|
||||
|
||||
// periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly
|
||||
extension AttributeScopes {
|
||||
struct ElementXAttributes: AttributeScope {
|
||||
let blockquote: BlockquoteAttribute
|
||||
@@ -69,6 +70,7 @@ extension AttributeScopes {
|
||||
var elementX: ElementXAttributes.Type { ElementXAttributes.self }
|
||||
}
|
||||
|
||||
// periphery: ignore - required to make NSAttributedString to AttributedString conversion even if not used directly
|
||||
extension AttributeDynamicLookup {
|
||||
subscript<T: AttributedStringKey>(dynamicMember keyPath: KeyPath<AttributeScopes.ElementXAttributes, T>) -> T {
|
||||
self[T.self]
|
||||
|
||||
Reference in New Issue
Block a user