Fix building for visionOS

This commit is contained in:
Shadowfacts 2024-01-26 11:15:21 -05:00
parent 94f71541f8
commit b4bdf8b0dc
2 changed files with 8 additions and 7 deletions

View File

@ -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)
}
}

View File

@ -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 {