mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
MessageText component (#1521)
* MessageText component * swiftformat * fix swift format being a bit crazy * link tapping support * new test + fix for font + dynamic support * fix for blockquote issue. * code improvement * small code improvement and fixed tests not working due to weird swiftformat behaviour * fix boost emoji * updated swiftformat * better testing * UI tests updated * fixing the issue with the cache overriding the size category changes * whitespaces * appropriate color + better info plist parsing * cleaned the code and fixed links * tapping link fixes * list bug fix * ui tests regenerated
This commit is contained in:
@@ -25,6 +25,10 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
private let permalinkBaseURL: URL
|
||||
|
||||
private static var cache = LRUCache<String, AttributedString>(countLimit: 1000)
|
||||
|
||||
static func invalidateCache() {
|
||||
cache.removeAllValues()
|
||||
}
|
||||
|
||||
init(permalinkBaseURL: URL) {
|
||||
self.permalinkBaseURL = permalinkBaseURL
|
||||
@@ -64,10 +68,7 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
return cached
|
||||
}
|
||||
|
||||
// Trick DTCoreText into preserving newlines
|
||||
let adjustedHTMLString = htmlString.replacingOccurrences(of: "\n", with: "<br>")
|
||||
|
||||
guard let data = adjustedHTMLString.data(using: .utf8) else {
|
||||
guard let data = htmlString.data(using: .utf8) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user