damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 366d46dfabd0060c93426cf040900d5592214994
parent 9efc900851acc71760c66f942163c966aafa87bc
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 18 Nov 2022 12:31:08 -0800

remove markdown support

Will re-add once there is a markdown spec

Diffstat:
Mdamus/Views/NoteContentView.swift | 22++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift @@ -11,7 +11,7 @@ struct NoteArtifacts { let content: String let images: [URL] let invoices: [Invoice] - + static func just_content(_ content: String) -> NoteArtifacts { NoteArtifacts(content: content, images: [], invoices: []) } @@ -39,7 +39,7 @@ func render_note_content(ev: NostrEvent, profiles: Profiles, privkey: String?) - return str + url.absoluteString } } - + return NoteArtifacts(content: txt, images: img_urls, invoices: invoices) } @@ -52,21 +52,15 @@ struct NoteContentView: View { let privkey: String? let event: NostrEvent let profiles: Profiles - + let show_images: Bool - + @State var artifacts: NoteArtifacts - + func MainContent() -> some View { - let md_opts: AttributedString.MarkdownParsingOptions = - .init(interpretedSyntax: .inlineOnlyPreservingWhitespace) - return VStack(alignment: .leading) { - if let txt = try? AttributedString(markdown: artifacts.content, options: md_opts) { - Text(txt) - } else { - Text(artifacts.content) - } + Text(artifacts.content) + if show_images && artifacts.images.count > 0 { ImageCarousel(urls: artifacts.images) } @@ -76,7 +70,7 @@ struct NoteContentView: View { } } } - + var body: some View { MainContent() .onAppear() {