Skip to content

HTMLSAXParser 1.0 - Swift 6

Latest

Choose a tag to compare

@raymccrae raymccrae released this 31 Aug 18:27

HTMLSAXParser 1.0

HTMLSAXParser 1.0 modernizes the library for Swift 6 while preserving its synchronous SAX-style parsing API.

Highlights

  • Enables Swift 6 language mode and strict concurrency checking.
  • Removes the C error-callback shim and imports Apple’s libxml2 module directly.
  • Makes HTMLSAXParser immutable, final, and Sendable.
  • Uses independent SAX handlers for safe concurrent parsing.
  • Adds structured libxml2 warning and error handling.
  • Improves HTML entity encoding and checked integer conversions.
  • Adds Swift Testing coverage for parsing events, encodings, malformed input, cancellation, entity encoding, and concurrent use.
  • Supports macOS 10.15, iOS 13, tvOS 13, watchOS 6, and visionOS 1 or later.

Breaking changes

  • Swift 6 is now required.
  • HTMLSAXParser can no longer be subclassed.
  • Distribution is Swift Package Manager only; the legacy Xcode project and demo application were removed.
  • Oversized input throws HTMLSAXParser.Error.inputTooLarge.
  • Invalid parse-option values throw HTMLSAXParser.Error.invalidParseOptions.

Existing parsing methods, events, options, and HTML entity-encoding methods otherwise retain their names and behavior.