Fix building for visionOS
This commit is contained in:
parent
94f71541f8
commit
b4bdf8b0dc
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue