From 71ceb2fc40d18c80073a6bffe588a9d3e73dc46a Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 15 Dec 2022 16:33:25 +0100 Subject: [PATCH] fix that works both iOS 15 and iOS 16 --- .../MatrixKit/Utils/EventFormatter/HTMLFormatter.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift b/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift index 4e36fa6c5..de1b19821 100644 --- a/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift +++ b/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift @@ -51,10 +51,6 @@ class HTMLFormatter: NSObject { DTDefaultFontName: font.fontName, DTDefaultFontSize: font.pointSize, DTDefaultLinkDecoration: false, - /* This fixes the issue where links are displayed in black - on DTCoreText 1.6.26, the provided value does not matter - the tintColor of the UI element will be used for links */ - DTDefaultLinkColor: "", DTWillFlushBlockCallBack: sanitizeCallback ] options.merge(extraOptions) { (_, new) in new } @@ -66,7 +62,11 @@ class HTMLFormatter: NSObject { let mutableString = NSMutableAttributedString(attributedString: string) MXKTools.removeDTCoreTextArtifacts(mutableString) postFormatOperations?(mutableString) - + + // Remove CTForegroundColorFromContext attribute to fix the iOS 16 black link color issue + // REF: https://github.com/Cocoanetics/DTCoreText/issues/792 + mutableString.removeAttribute(NSAttributedString.Key("CTForegroundColorFromContext"), range: NSRange(location: 0, length: mutableString.length)) + return mutableString }