Releases: chrisdhaan/CDMarkdownKit
Releases · chrisdhaan/CDMarkdownKit
Release list
4.0.1
4.0.1
Released on 2026-06-15.
Fixed
- Fixed infinite recursion in
CDColor.labelon iOS, tvOS, watchOS, and visionOS. The property was defined in an extension onCDColor(a typealias forUIColor) and calledUIColor.label, which resolved back to itself. The extension now only defineslabelon macOS whereNSColor.labelColorrequires bridging; on Apple's other platformsUIColor.labelis used directly.
4.0.0
4.0.0
Released on 2026-06-15.
Added
- Added
CDMarkdownTextLayoutManager, a customNSTextLayoutManagersubclass used as the TextKit 2 layout manager forCDMarkdownLabelandCDMarkdownTextViewon iOS/tvOS 16+. Delegates fragment creation toCDMarkdownTextLayoutFragmentand exposes aroundAllCornersproperty that propagates to each fragment. - Added
CDMarkdownTextLayoutFragment, a customNSTextLayoutFragmentsubclass that draws rounded-corner backgrounds for code and syntax spans in the TextKit 2 rendering path. Reads the.backgroundColorattribute from text storage at draw time so code and syntax blocks each use their correct color. - Added TextKit 2 rendering path to
CDMarkdownLabelon iOS/tvOS 16+. Text layout, rect measurement, glyph-position calculation, and link hit-testing all useNSTextLayoutManagerwhen TextKit 2 is active; TextKit 1 fallback is preserved for iOS/tvOS 15. - Added TextKit 2 rendering path to
CDMarkdownTextViewon iOS/tvOS 16+.configureTK2()installsCDMarkdownTextLayoutManagervia KVC;configureTK1()continues to installCDMarkdownLayoutManageron iOS/tvOS 15. - Added
CDMarkdownTextView.makeTextView(frame:)public factory method. Preferred way to construct aCDMarkdownTextViewprogrammatically — selects TextKit 2 on iOS/tvOS 16+ and TextKit 1 on iOS/tvOS 15 automatically.
Changed
- Raised minimum deployment targets:
- iOS: 12.0 → 13.0
- macOS: 10.13 → 10.15
- tvOS: 12.0 → 13.0
- watchOS: 4.0 → 6.0
- Improved Swift 6 strict concurrency: removed
@preconcurrencyimports,@unchecked Sendableconformances, andnonisolated(unsafe)from parser properties; added@MainActorto all sixteen element classes and base protocol declarations; added@MainActorto theNSLayoutManagerDelegateextension. - Replaced
DispatchQueue.main.asyncAfterwithTask.sleepin the async parsing pipeline to align with structured Swift concurrency.
3.3.0
3.3.0
Released on 2026-06-07.
Added
- Added
cdMarkdownCodeLanguageattribute key. Applied to fenced code block ranges when a language hint is present (e.g.```swift). Value is aStringcontaining the language identifier exactly as written after the opening fence. - Added
CDMarkdownLinkReferenceelement for parsing reference-style links ([text][ref]with[ref]: urldefinitions). Reference definitions are stripped from the rendered output and resolved to.linkattributes at parse time. - Added
cdMarkdownLinkTitleattribute key for the optional title string from a reference link definition. Value is aString(without surrounding quotes or parentheses). Present only when the definition included a title. - Added
CDMarkdownThemestruct for unified styling of all parser elements. Bundles font, color, and per-element overrides (HeaderTheme,InlineTheme,LinkTheme) into a single value. - Added
CDMarkdownTheme.defaultandCDMarkdownTheme.systemDarkstatic factory themes. - Added
CDMarkdownParser.init(theme:)convenience initializer that configures the parser from aCDMarkdownTheme. - Added theme convenience initializers to
CDMarkdownViewandCDMarkdownText. - Added
markdownThemeSwiftUI environment key and.markdownTheme(_:)view modifier so a theme can be injected into an entire view hierarchy. - Added iOS 17+
textView(_:primaryActionFor:defaultAction:)delegate method toCDMarkdownView.Coordinatorfor correct link-tap behaviour on visionOS and iOS 17+.
Fixed
- Fixed reference link definitions inside fenced code blocks being incorrectly extracted as link definitions.
- Fixed
UITextItemInteractiondeprecation warning on visionOS. - Fixed
CDMarkdownTextnot re-parsing when themarkdownThemeenvironment value changes.
3.2.0
3.2.0
Released on 2026-05-31.
Added
- Added Swift 6 language mode (
swiftLanguageModes: [.v6]) toPackage.swift. - Added
CDMarkdownTaskListelement for parsing GFM task list items (- [ ]/- [x]). - Added
CDMarkdownHorizontalRuleelement for parsing horizontal rules (---,***,___). - Added inline markdown parsing inside GFM table cells (bold, italic, links, inline code).
- Added
disabledElementTypes,disable(_:), andenable(_:)toCDMarkdownParserfor opting out of individual default elements. - Added
insertCustomElement(_:before:)andinsertCustomElement(_:after:)toCDMarkdownParserfor precise pipeline positioning. - Added accessibility attribute keys (
cdMarkdownHeadingLevel,cdMarkdownIsCode,cdMarkdownIsBlockquote) andaccessibilityAttributedString(from:)helper onCDMarkdownParser. - Added
CDMarkdownNSLayoutManager,CDMarkdownNSTextView, andCDMarkdownNSLabel— AppKit UI components for macOS. - Added
CDMarkdownTextandCDMarkdownView— SwiftUI wrappers for iOS, tvOS, macOS, watchOS, and visionOS. - Added
markdownParserSwiftUI environment key and.markdownParser(_:)view modifier.
Updated
- Deprecated synchronous
parse(_:)overloads in favour of the async overloads.
3.1.0
3.1.0
Released on 2026-05-12.
Added
- Added
CDMarkdownOrderedListelement for parsing ordered (numbered) lists. - Added
CDMarkdownTableelement for parsing GitHub Flavored Markdown pipe tables. - Added
preserveLeadingWhitespaceconfiguration property toCDMarkdownParser. Whentrue, leading whitespace is preserved in inline code spans and fenced code blocks. - Added visionOS platform support to
Package.swift,CDMarkdownKit.podspec, all source file platform guards, and CI. - Added native DocC documentation catalog (
Source/CDMarkdownKit.docc/) with landing page and Getting Started article.
Updated
- Migrated documentation hosting from Jazzy to DocC. Removed
.jazzy.yamland thejazzygem; addedswift-docc-plugindependency toPackage.swift; regenerateddocs/with DocC static site output. - Extended inline doc comments across all source files for full DocC compatibility.
- Updated CI to add a visionOS build job and replace the Jazzy documentation job with a DocC build job.
3.0.0
What's Changed
- modernize: CDMarkdownKit v3.0.0 by @chrisdhaan in #51
- docs: Update CHANGELOG.md for 3.0.0 release by @chrisdhaan in #52
Full Changelog: 2.5.1...3.0.0
SDK Support
Added
- Swift 5.7
Updated
- CI: Tests device, platform, Xcode, and SDK versions
Markdown Parsing
Added
- Underline color and style on all elements