Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Jun 29, 2023
1 parent b80fbf6 commit ad4c5ea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ struct RoomEventStringBuilder {
}

func prefix(_ eventSummary: String, with sender: TimelineItemSender) -> AttributedString {
let attributedEventSummary = AttributedString(eventSummary.trimmingCharacters(in: .whitespacesAndNewlines))
if let senderDisplayName = sender.displayName,
let attributedSenderDisplayName = try? AttributedString(markdown: "**\(senderDisplayName)**") {
// Don't include the message body in the markdown otherwise it makes tappable links.
return attributedSenderDisplayName + ": " + AttributedString(eventSummary.trimmingCharacters(in: .whitespacesAndNewlines))
return attributedSenderDisplayName + ": " + attributedEventSummary
} else {
return AttributedString(eventSummary.trimmingCharacters(in: .whitespacesAndNewlines))
return attributedEventSummary
}
}
}

0 comments on commit ad4c5ea

Please sign in to comment.