From afe25c34fe30142f69aa1833a39582a9bfd1aa5e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 2 Nov 2023 13:06:04 +0800 Subject: [PATCH] Fix markdown of the notifications text --- .../Profile/PushNotificationSettingsView.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift index a0419ce83..60fb512f9 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/PushNotificationSettingsView.swift @@ -66,6 +66,19 @@ .task { viewModel.checkPushNotificationsStatus() } } + private var notificationsText: some View { + let markdown = "\(LocalText.notificationsExplainer)\n\n\(LocalText.notificationsTriggerExplainer)" + if let notificationsText = try? AttributedString( + markdown: markdown, + options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace) + ) { + return Text(notificationsText) + .accentColor(.blue) + } + return Text(markdown) + .accentColor(.blue) + } + private var innerBody: some View { Group { Section { @@ -75,8 +88,7 @@ } Section { - Text("\(LocalText.notificationsExplainer)\n\(LocalText.notificationsTriggerExplainer)") - .accentColor(.blue) + notificationsText } Section {