forked from shadowfacts/Tusker
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 {
|
private struct NoteTextView: UIViewRepresentable {
|
||||||
typealias UIViewType = StatusContentTextView
|
typealias UIViewType = ContentTextView
|
||||||
let note: String
|
let note: String
|
||||||
func makeUIView(context: Context) -> StatusContentTextView {
|
func makeUIView(context: Context) -> ContentTextView {
|
||||||
let view = StatusContentTextView()
|
let view = ContentTextView()
|
||||||
view.isUserInteractionEnabled = false
|
view.isUserInteractionEnabled = false
|
||||||
view.isScrollEnabled = true
|
view.isScrollEnabled = true
|
||||||
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
func updateUIView(_ uiView: StatusContentTextView, context: Context) {
|
func updateUIView(_ uiView: ContentTextView, context: Context) {
|
||||||
uiView.setTextFromHtml(note)
|
uiView.setBodyTextFromHTML(note)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Pachyderm
|
import Pachyderm
|
||||||
import WebURLFoundationExtras
|
import WebURLFoundationExtras
|
||||||
import SwiftSoup
|
import HTMLStreamer
|
||||||
|
|
||||||
struct TrendingLinkCardView: View {
|
struct TrendingLinkCardView: View {
|
||||||
let card: Card
|
let card: Card
|
||||||
|
@ -24,7 +24,8 @@ struct TrendingLinkCardView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
private var descriptionText: String {
|
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 {
|
var body: some View {
|
||||||
|
|
Loading…
Reference in New Issue