Add mention parsing and fine-grained text selection on description in ProfileView

Changelog-Added: Add mention parsing and fine-grained text selection on description in ProfileView
Closes: #1172
This commit is contained in:
2023-05-25 12:03:31 -04:00
committed by William Casarin
parent f9a572faa2
commit 0552c24108
5 changed files with 22 additions and 5 deletions

View File

@@ -43,7 +43,9 @@ struct UserView: View {
let profile = damus_state.profiles.lookup(id: pubkey)
ProfileName(pubkey: pubkey, profile: profile, damus: damus_state, show_nip5_domain: false)
if let about = profile?.about {
Text(about)
let blocks = parse_mentions(content: about, tags: [])
let about_string = render_blocks(blocks: blocks, profiles: damus_state.profiles).content.attributed
Text(about_string)
.lineLimit(3)
.font(.footnote)
}