mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-02 20:16:54 +01:00
Use API that works on both macOS and iOS
This commit is contained in:
parent
ba73e3289a
commit
dc787620c5
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user