summaryrefslogtreecommitdiff
path: root/Hutch/Views/Settings/SettingsView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-18 20:23:58 -0500
committerChristian Cleberg <[email protected]>2026-03-18 20:23:58 -0500
commitc41cd437acde4e4f4c0781cebd4d5f4bf9517bb9 (patch)
tree28bf13b89e36774720d015a26a8979b567ad0be9 /Hutch/Views/Settings/SettingsView.swift
parent1745311950fd68ad81957b3ba64f8566cd86ce19 (diff)
parent4dd920558a1c7174c0e9a5b872325df36e363516 (diff)
downloadhutch-c41cd437acde4e4f4c0781cebd4d5f4bf9517bb9.tar.gz
hutch-c41cd437acde4e4f4c0781cebd4d5f4bf9517bb9.tar.bz2
hutch-c41cd437acde4e4f4c0781cebd4d5f4bf9517bb9.zip
v1.2: Merge branch 'dev'
Diffstat (limited to 'Hutch/Views/Settings/SettingsView.swift')
-rw-r--r--Hutch/Views/Settings/SettingsView.swift35
1 files changed, 27 insertions, 8 deletions
diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift
index 5bbded8..9b7d41f 100644
--- a/Hutch/Views/Settings/SettingsView.swift
+++ b/Hutch/Views/Settings/SettingsView.swift
@@ -1,6 +1,10 @@
import PhotosUI
import SwiftUI
+private let settingsBioMarkdownOptions = AttributedString.MarkdownParsingOptions(
+ interpretedSyntax: .inlineOnlyPreservingWhitespace
+)
+
struct SettingsView: View {
@Environment(AppState.self) private var appState
@Environment(\.colorScheme) private var colorScheme
@@ -163,13 +167,7 @@ struct SettingsView: View {
Text("Bio")
.font(.caption)
.foregroundStyle(.secondary)
- RenderedMarkupContentView(
- content: .markdown(bio),
- readmePath: nil,
- colorScheme: colorScheme,
- ownerCanonicalName: "",
- repositoryName: ""
- )
+ SettingsBioView(markdown: bio)
}
}
@@ -424,6 +422,27 @@ struct SettingsView: View {
}
}
+private struct SettingsBioView: View {
+ let markdown: String
+
+ var body: some View {
+ Text(settingsBioAttributedString(markdown))
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .tint(.accentColor)
+ .textSelection(.enabled)
+ }
+}
+
+func settingsBioAttributedString(_ markdown: String) -> AttributedString {
+ guard let attributed = try? AttributedString(
+ markdown: markdown,
+ options: settingsBioMarkdownOptions
+ ) else {
+ return AttributedString(markdown)
+ }
+ return attributed
+}
+
// MARK: - Edit Profile Sheet
private struct EditProfileSheet: View {
@@ -695,7 +714,7 @@ private struct AboutView: View {
Link(destination: URL(string: "https://man.sr.ht")!) {
SwiftUI.Label("SourceHut Manuals", systemImage: "book")
}
- Link(destination: URL(string: "https://git.sr.ht/~ccleberg/Hutch")!) {
+ Link(destination: URL(string: "https://sr.ht/~ccleberg/Hutch")!) {
SwiftUI.Label("Project Repository", systemImage: "folder")
}
}