Skip to content

2.0.0

Choose a tag to compare

@AppleArealidea AppleArealidea released this 31 Mar 15:17
· 4 commits to main since this release

Release 2.0.0

Breaking Changes

  • Renamed MarkdownParser.attributedString(fromMardown:...) → attributedString(fromMarkdown:...) — fixed typo in the parameter label
  • Renamed return tuple label isCutted → isTruncated in MarkdownParser.attributedString(...)
  • Removed NSObject inheritance from MarkdownParser
  • backingStore in MarkdownTextStorage is now private (was previously accessible)

Bug Fixes

  • Fixed bold and italic styles not combining correctly — italic trait from the existing font was ignored when overlaying a new style
  • Fixed performReplacementsForRange losing the expanded line range on multi-line edits
  • Fixed setDefaultFont(_:) not rebuilding highlight patterns after a font change

Crash Fixes

  • Fixed potential crashes from force unwraps in createAttributesForFont and fontWithBoldTrait when a font does not support requested traits — now safely falls back to the original or system font

Improvements

  • Cached compiled NSRegularExpression instances in highlighters instead of recompiling on every editing pass
  • Added proper beginEditing()/endEditing() wrapping in setDefaultFont(_:)
  • Added platforms: [.iOS(.v13)] to Package.swift
  • Updated README with full documentation, usage examples, and installation instructions

Migration Guide

// Before (1.x)
let (result, isCutted) = MarkdownParser.attributedString(
    fromMardown: text, font: font
)

// After (2.0.0)
let (result, isTruncated) = MarkdownParser.attributedString(
    fromMarkdown: text, font: font
)