diff --git a/Tusker/Screens/Explore/SuggestedProfileCardView.swift b/Tusker/Screens/Explore/SuggestedProfileCardView.swift index b6296403..40d95bc2 100644 --- a/Tusker/Screens/Explore/SuggestedProfileCardView.swift +++ b/Tusker/Screens/Explore/SuggestedProfileCardView.swift @@ -58,17 +58,17 @@ private struct HeaderLayout: Layout { } private struct NoteTextView: UIViewRepresentable { - typealias UIViewType = StatusContentTextView + typealias UIViewType = ContentTextView let note: String - func makeUIView(context: Context) -> StatusContentTextView { - let view = StatusContentTextView() + func makeUIView(context: Context) -> ContentTextView { + let view = ContentTextView() view.isUserInteractionEnabled = false view.isScrollEnabled = true view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) return view } - func updateUIView(_ uiView: StatusContentTextView, context: Context) { - uiView.setTextFromHtml(note) + func updateUIView(_ uiView: ContentTextView, context: Context) { + uiView.setBodyTextFromHTML(note) } } diff --git a/Tusker/Screens/Explore/TrendingLinkCardView.swift b/Tusker/Screens/Explore/TrendingLinkCardView.swift index 0c332877..735f1257 100644 --- a/Tusker/Screens/Explore/TrendingLinkCardView.swift +++ b/Tusker/Screens/Explore/TrendingLinkCardView.swift @@ -10,7 +10,7 @@ import SwiftUI import Pachyderm import WebURLFoundationExtras -import SwiftSoup +import HTMLStreamer struct TrendingLinkCardView: View { let card: Card @@ -24,7 +24,8 @@ struct TrendingLinkCardView: View { } private var descriptionText: String { - try! SwiftSoup.parseBodyFragment(card.description).text() + var converter = TextConverter(configuration: .init(insertNewlines: false)) + return converter.convert(html: card.description) } var body: some View {