diff --git a/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSCore/Views.swift b/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSCore/Views.swift index 571079c..59c9c29 100644 --- a/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSCore/Views.swift +++ b/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSCore/Views.swift @@ -526,7 +526,7 @@ public struct MessageRow: View { .font(.caption) .foregroundStyle(.secondary) } - Text(message.text) + Text(renderedText) .textSelection(.enabled) if !message.reactions.isEmpty { Text(message.reactions.map(\.emoji).joined(separator: " ")) @@ -552,6 +552,17 @@ public struct MessageRow: View { } } } + + private var renderedText: AttributedString { + ( + try? AttributedString( + markdown: message.text, + options: AttributedString.MarkdownParsingOptions( + interpretedSyntax: .inlineOnlyPreservingWhitespace + ) + ) + ) ?? AttributedString(message.text) + } } public struct ComposeBar: View {