mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
fix that works both iOS 15 and iOS 16
This commit is contained in:
parent
9c1341118c
commit
0633eedc06
1 changed files with 5 additions and 5 deletions
|
@ -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 }
|
||||
|
@ -67,6 +63,10 @@ class HTMLFormatter: NSObject {
|
|||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue