mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix for line breaks (#2224)
This commit is contained in:
@@ -73,14 +73,16 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
|
||||
// that could happen with the default HTML renderer of NSAttributedString which is a
|
||||
// webview.
|
||||
func fromHTML(_ htmlString: String?) -> AttributedString? {
|
||||
guard let htmlString else {
|
||||
guard var originalHTMLString = htmlString else {
|
||||
return nil
|
||||
}
|
||||
|
||||
if let cached = Self.caches[cacheKey]?.value(forKey: htmlString) {
|
||||
if let cached = Self.caches[cacheKey]?.value(forKey: originalHTMLString) {
|
||||
return cached
|
||||
}
|
||||
|
||||
let htmlString = originalHTMLString.replacingHtmlBreaksOccurrences()
|
||||
|
||||
guard let data = htmlString.data(using: .utf8) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user