mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 02:26:37 +00:00
refactor: Use MarkdownContentView in rich chat bubbles
Replace inline AttributedString(markdown:) in RichMessageBubble with the shared MarkdownContentView for consistent styled rendering of headers, lists, blockquotes, and inline formatting in chat messages. Code blocks continue to use CodeBlockView with its copy button. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -76,13 +76,7 @@ struct RichMessageBubble: View {
|
||||
ForEach(Array(blocks.enumerated()), id: \.offset) { _, block in
|
||||
switch block {
|
||||
case .text(let text):
|
||||
if let attributed = try? AttributedString(markdown: text, options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace)) {
|
||||
Text(attributed)
|
||||
.textSelection(.enabled)
|
||||
} else {
|
||||
Text(text)
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
MarkdownContentView(content: text)
|
||||
case .code(let code, let language):
|
||||
CodeBlockView(code: code, language: language)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user