From dc787620c5ca2845243ff3eb724be29794d131eb Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Wed, 15 Apr 2020 16:45:21 -0500 Subject: [PATCH] Use API that works on both macOS and iOS --- .../Timeline/Cell/NSAttributedString+NetNewsWire.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mac/MainWindow/Timeline/Cell/NSAttributedString+NetNewsWire.swift b/Mac/MainWindow/Timeline/Cell/NSAttributedString+NetNewsWire.swift index 28a5d89df..b572001ee 100644 --- a/Mac/MainWindow/Timeline/Cell/NSAttributedString+NetNewsWire.swift +++ b/Mac/MainWindow/Timeline/Cell/NSAttributedString+NetNewsWire.swift @@ -83,7 +83,8 @@ extension NSAttributedString { convenience init(html: String) { let data = html.data(using: .utf8)! - self.init(html: data, options: [.characterEncoding: String.Encoding.utf8.rawValue], documentAttributes: nil)! + let options: [NSAttributedString.DocumentReadingOptionKey: Any] = [.characterEncoding: String.Encoding.utf8.rawValue, .documentType: NSAttributedString.DocumentType.html] + try! self.init(data: data, options: options, documentAttributes: nil) } }