artifacts: allow unseparated note artifacts

This is needed for longform events. Right now we treat unseparated note
artifacts as a list of blocks, but we will likely need to render these
blocks into lists of attributed texts with image blocks inbetween.
This commit is contained in:
William Casarin
2023-06-04 15:42:32 -07:00
parent 4d995fd04c
commit 374610a21a
17 changed files with 378 additions and 121 deletions

View File

@@ -33,6 +33,18 @@ class MarkdownTests: XCTestCase {
let expected = try AttributedString(markdown: "prologue [damus.io](https://damus.io) epilogue", options: md_opts)
XCTAssertEqual(md, expected)
}
func test_longform_rendering() throws {
let st = test_damus_state()
let artifacts = render_note_content(ev: test_longform_event.event, profiles: st.profiles, privkey: st.keypair.privkey)
switch artifacts {
case .separated:
XCTAssert(false)
case .parts(let parts):
XCTAssertEqual(parts.parts.count, 1)
}
}
func test_convert_links() throws {
let helper = Markdown()