From 521c6d63fc86492a559d6dd16087b36ad53f7420 Mon Sep 17 00:00:00 2001 From: Alan Wizemann Date: Thu, 9 Apr 2026 00:13:17 -0400 Subject: [PATCH] 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) --- scarf/scarf/Features/Chat/Views/RichMessageBubble.swift | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scarf/scarf/Features/Chat/Views/RichMessageBubble.swift b/scarf/scarf/Features/Chat/Views/RichMessageBubble.swift index 187600b..c9dfc7f 100644 --- a/scarf/scarf/Features/Chat/Views/RichMessageBubble.swift +++ b/scarf/scarf/Features/Chat/Views/RichMessageBubble.swift @@ -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) }