Repository navigation
2.0.3 — Range safety: fix out-of-bounds crash on text input
Fixes a fatal NSRangeException (NSMutableRLEArray ... Out of bounds) thrown from MarkdownTextStorage while typing in a UITextView.
Fixed
The UIKit text-input subsystem (predictive text, dictation, marked text) could hand MarkdownTextStorage a range whose end exceeded the backing store length before the store had caught up. Forwarding it straight to NSMutableAttributedString crashed the host app.
All NSTextStorage primitives now clamp incoming ranges/locations to the real backing store length: replaceCharacters(in:with:), attributes(at:effectiveRange:), setAttributes(_:range:). edited(...) bookkeeping stays consistent with the range actually applied.
Added
SwiftPM test target with range-safety regression tests (out-of-bounds replace/attributes/setAttributes, empty store, negative location, in-bounds sanity).
No public API changes — fully source-compatible with 2.0.2.