A pure-Swift, zero-dependency framework for parsing Markdown text into styled NSAttributedString.
- Parse Markdown to styled
NSAttributedString - Support for bold, italic, strikethrough, headers, lists, quotes, code blocks
- Clickable links and automatic URL detection
- Image rendering (iOS, macOS, tvOS)
- Async image loading with
async/await - Custom Markdown elements
-
UILabelandUITextViewsubclasses with Markdown support - Swift 6 concurrency safety
import CDMarkdownKit
let parser = CDMarkdownParser()
let markdown = "# Hello **World**\n\nThis is *italic* text."
let attributedString = parser.parse(markdown)
label.attributedText = attributedString| Platform | Minimum OS | Swift | Installation |
|---|---|---|---|
| iOS | 12.0+ | 5.3+ | SPM, CocoaPods |
| macOS | 10.13+ | 5.3+ | SPM, CocoaPods |
| tvOS | 12.0+ | 5.3+ | SPM, CocoaPods |
| watchOS | 4.0+ | 5.3+ | SPM, CocoaPods |
| visionOS | 1.0+ | 5.3+ | SPM, CocoaPods |
Add to your Package.swift:
.package(url: "https://github.com/chrisdhaan/CDMarkdownKit.git", from: "3.0.0")Or in Xcode: File → Add Packages and enter the repository URL.
Add to your Podfile:
pod 'CDMarkdownKit', '~> 3.0'Run pod install.
For comprehensive usage documentation including styling, custom elements, and platform-specific information, see Documentation/Usage.md.
We welcome contributions! Before contributing to CDMarkdownKit, please read the detailed instructions in our contribution guide. We maintain high standards for code quality and test coverage, and we're happy to help you get your changes integrated.
CDMarkdownKit is available under the MIT license. See the LICENSE file for more info.
