Skip to content

Releases: chrisdhaan/CDMarkdownKit

4.0.1

Choose a tag to compare

@chrisdhaan chrisdhaan released this 15 Jun 22:24
49819c5

4.0.1

Released on 2026-06-15.

Fixed

  • Fixed infinite recursion in CDColor.label on iOS, tvOS, watchOS, and visionOS. The property was defined in an extension on CDColor (a typealias for UIColor) and called UIColor.label, which resolved back to itself. The extension now only defines label on macOS where NSColor.labelColor requires bridging; on Apple's other platforms UIColor.label is used directly.

4.0.0

Choose a tag to compare

@chrisdhaan chrisdhaan released this 15 Jun 20:40
535e382

4.0.0

Released on 2026-06-15.

Added

  • Added CDMarkdownTextLayoutManager, a custom NSTextLayoutManager subclass used as the TextKit 2 layout manager for CDMarkdownLabel and CDMarkdownTextView on iOS/tvOS 16+. Delegates fragment creation to CDMarkdownTextLayoutFragment and exposes a roundAllCorners property that propagates to each fragment.
  • Added CDMarkdownTextLayoutFragment, a custom NSTextLayoutFragment subclass that draws rounded-corner backgrounds for code and syntax spans in the TextKit 2 rendering path. Reads the .backgroundColor attribute from text storage at draw time so code and syntax blocks each use their correct color.
  • Added TextKit 2 rendering path to CDMarkdownLabel on iOS/tvOS 16+. Text layout, rect measurement, glyph-position calculation, and link hit-testing all use NSTextLayoutManager when TextKit 2 is active; TextKit 1 fallback is preserved for iOS/tvOS 15.
  • Added TextKit 2 rendering path to CDMarkdownTextView on iOS/tvOS 16+. configureTK2() installs CDMarkdownTextLayoutManager via KVC; configureTK1() continues to install CDMarkdownLayoutManager on iOS/tvOS 15.
  • Added CDMarkdownTextView.makeTextView(frame:) public factory method. Preferred way to construct a CDMarkdownTextView programmatically — 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 @preconcurrency imports, @unchecked Sendable conformances, and nonisolated(unsafe) from parser properties; added @MainActor to all sixteen element classes and base protocol declarations; added @MainActor to the NSLayoutManagerDelegate extension.
  • Replaced DispatchQueue.main.asyncAfter with Task.sleep in the async parsing pipeline to align with structured Swift concurrency.

3.3.0

Choose a tag to compare

@chrisdhaan chrisdhaan released this 09 Jun 01:26
f989060

3.3.0

Released on 2026-06-07.

Added

  • Added cdMarkdownCodeLanguage attribute key. Applied to fenced code block ranges when a language hint is present (e.g. ```swift). Value is a String containing the language identifier exactly as written after the opening fence.
  • Added CDMarkdownLinkReference element for parsing reference-style links ([text][ref] with [ref]: url definitions). Reference definitions are stripped from the rendered output and resolved to .link attributes at parse time.
  • Added cdMarkdownLinkTitle attribute key for the optional title string from a reference link definition. Value is a String (without surrounding quotes or parentheses). Present only when the definition included a title.
  • Added CDMarkdownTheme struct for unified styling of all parser elements. Bundles font, color, and per-element overrides (HeaderTheme, InlineTheme, LinkTheme) into a single value.
  • Added CDMarkdownTheme.default and CDMarkdownTheme.systemDark static factory themes.
  • Added CDMarkdownParser.init(theme:) convenience initializer that configures the parser from a CDMarkdownTheme.
  • Added theme convenience initializers to CDMarkdownView and CDMarkdownText.
  • Added markdownTheme SwiftUI 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 to CDMarkdownView.Coordinator for 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 UITextItemInteraction deprecation warning on visionOS.
  • Fixed CDMarkdownText not re-parsing when the markdownTheme environment value changes.

3.2.0

Choose a tag to compare

@chrisdhaan chrisdhaan released this 31 May 18:49

3.2.0

Released on 2026-05-31.

Added

  • Added Swift 6 language mode (swiftLanguageModes: [.v6]) to Package.swift.
  • Added CDMarkdownTaskList element for parsing GFM task list items (- [ ] / - [x]).
  • Added CDMarkdownHorizontalRule element for parsing horizontal rules (---, ***, ___).
  • Added inline markdown parsing inside GFM table cells (bold, italic, links, inline code).
  • Added disabledElementTypes, disable(_:), and enable(_:) to CDMarkdownParser for opting out of individual default elements.
  • Added insertCustomElement(_:before:) and insertCustomElement(_:after:) to CDMarkdownParser for precise pipeline positioning.
  • Added accessibility attribute keys (cdMarkdownHeadingLevel, cdMarkdownIsCode, cdMarkdownIsBlockquote) and accessibilityAttributedString(from:) helper on CDMarkdownParser.
  • Added CDMarkdownNSLayoutManager, CDMarkdownNSTextView, and CDMarkdownNSLabel — AppKit UI components for macOS.
  • Added CDMarkdownText and CDMarkdownView — SwiftUI wrappers for iOS, tvOS, macOS, watchOS, and visionOS.
  • Added markdownParser SwiftUI environment key and .markdownParser(_:) view modifier.

Updated

  • Deprecated synchronous parse(_:) overloads in favour of the async overloads.

3.1.0

Choose a tag to compare

@chrisdhaan chrisdhaan released this 15 May 03:34

3.1.0

Released on 2026-05-12.

Added

  • Added CDMarkdownOrderedList element for parsing ordered (numbered) lists.
  • Added CDMarkdownTable element for parsing GitHub Flavored Markdown pipe tables.
  • Added preserveLeadingWhitespace configuration property to CDMarkdownParser. When true, 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.yaml and the jazzy gem; added swift-docc-plugin dependency to Package.swift; regenerated docs/ 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

Choose a tag to compare

@chrisdhaan chrisdhaan released this 13 May 01:28
f835225

What's Changed

Full Changelog: 2.5.1...3.0.0

SDK Support

Choose a tag to compare

@chrisdhaan chrisdhaan released this 13 Dec 18:30
b089810

Added

  • Swift 5.7

Updated

  • CI: Tests device, platform, Xcode, and SDK versions

Markdown Parsing

Choose a tag to compare

@chrisdhaan chrisdhaan released this 12 Dec 18:15
85f7731

Added

  • Underline color and style on all elements

Markdown Parsing

Choose a tag to compare

@chrisdhaan chrisdhaan released this 03 Dec 16:01
c23c137

Added

  • Strikethrough

Markdown Parsing

Choose a tag to compare

@chrisdhaan chrisdhaan released this 17 Oct 20:37
96569d1

Added

  • squashNewlines parameter