mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 10:36:35 +00:00
481b937c33
Add a custom MarkdownContentView that renders markdown with visual styling — large headers, styled code blocks with language labels, bullet and numbered lists, blockquotes with colored borders, and horizontal rules. YAML frontmatter in skill files is hidden. Markdown rendering added to: - Memory view (MEMORY.md, USER.md) with live preview in editor - Skills view (.md files) with new edit/save capability - Session messages (assistant responses) - Dashboard text widgets Other changes: - Shared MarkdownRenderer utility for inline formatting - Split-pane editors (raw markdown left, live preview right) - saveSkillContent() in HermesFileService with path validation - Line breaks preserved in non-markdown content (Key: Value format) Closes #11 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
11 lines
390 B
Swift
11 lines
390 B
Swift
import Foundation
|
|
|
|
enum MarkdownRenderer {
|
|
/// Inline-only rendering — bold, italic, code spans, links. Preserves whitespace/newlines.
|
|
static func inlineAttributedString(_ text: String) -> AttributedString {
|
|
(try? AttributedString(markdown: text, options: .init(
|
|
interpretedSyntax: .inlineOnlyPreservingWhitespace
|
|
))) ?? AttributedString(text)
|
|
}
|
|
}
|