forked from zelo72/mastodon-ios
fix: server description may display in HTML format issue. resolve: #30
This commit is contained in:
parent
fab3902561
commit
33f1cfcc77
|
@ -8,6 +8,7 @@
|
||||||
import UIKit
|
import UIKit
|
||||||
import MastodonSDK
|
import MastodonSDK
|
||||||
import Kingfisher
|
import Kingfisher
|
||||||
|
import Kanna
|
||||||
|
|
||||||
protocol PickServerCellDelegate: class {
|
protocol PickServerCellDelegate: class {
|
||||||
func pickServerCell(modeChange server: Mastodon.Entity.Server, newMode: PickServerCell.Mode, updates: (() -> Void))
|
func pickServerCell(modeChange server: Mastodon.Entity.Server, newMode: PickServerCell.Mode, updates: (() -> Void))
|
||||||
|
@ -326,7 +327,13 @@ extension PickServerCell {
|
||||||
private func updateServerInfo() {
|
private func updateServerInfo() {
|
||||||
guard let serverInfo = server else { return }
|
guard let serverInfo = server else { return }
|
||||||
domainLabel.text = serverInfo.domain
|
domainLabel.text = serverInfo.domain
|
||||||
descriptionLabel.text = serverInfo.description
|
descriptionLabel.text = {
|
||||||
|
guard let html = try? HTML(html: serverInfo.description, encoding: .utf8) else {
|
||||||
|
return serverInfo.description
|
||||||
|
}
|
||||||
|
|
||||||
|
return html.text ?? serverInfo.description
|
||||||
|
}()
|
||||||
let processor = RoundCornerImageProcessor(cornerRadius: 3)
|
let processor = RoundCornerImageProcessor(cornerRadius: 3)
|
||||||
thumbImageView.kf.indicatorType = .activity
|
thumbImageView.kf.indicatorType = .activity
|
||||||
thumbImageView.kf.setImage(with: URL(string: serverInfo.proxiedThumbnail ?? "")!, placeholder: UIImage.placeholder(color: Asset.Colors.lightBackground.color), options: [
|
thumbImageView.kf.setImage(with: URL(string: serverInfo.proxiedThumbnail ?? "")!, placeholder: UIImage.placeholder(color: Asset.Colors.lightBackground.color), options: [
|
||||||
|
|
Loading…
Reference in New Issue