github fleeksoft/ksoup 0.2.4

latest release: 0.2.5
3 months ago

✨ Highlights

Area What’s new
Core API SimpleStreamReader for lightweight streaming.
Selector.evaluatorOf(css) for direct evaluator creation.
• Traversal helpers: NodeVisitor#traverse & NodeFilter#traverse.
TagSet#onNewTag(Consumer<Tag>) hook to customise tag handling.
Parser accuracy • Scripts inside <svg> now parsed with ScriptData mode.
• Inline-element whitespace preserved correctly.
TokenQueue reuses its CharacterReader buffer for lower allocations.
Networking • New ksoup-network-test module with mock-based test suite.
HttpClient always closed; inject a custom client if you need full control.
Tooling & CI GitHub Actions matrix simplified; macOS target added.
runTests.sh auto-expands default task list and supports space-delimited args.
• Mocha timeout bumped to 15 s for wasm tests.
Dependencies Kotlin 2.1.21, Ktor 3.1.3, Okio 3.11.0, jsoup 1.20.1, Gradle 8.14.1, maven-publish plugin 0.32.0.

🆕 Features

Streaming / IO

  • SimpleStreamReader for fast flat tokenised reads.
  • QuietAppender to silence noisy logs during tests.

DOM & selector APIs

  • Selector.evaluatorOf(css) – obtain an Evaluator without building a full Selector.
  • Traversal helpers: NodeVisitor#traverse, NodeFilter#traverse.

Tag System

  • TagSet#onNewTag(Consumer<Tag> customizer) lets libraries register extra behaviour on-the-fly.

🐛 Bug Fixes

  • Networking – always close HttpClient after each request.
    If you need a long-lived client, inject it with the new engine-factory hook.
  • HTML parsing
    • Scripts inside <svg> now handled in ScriptData state.
    • No whitespace trimming when the previous element was inline.
  • Miscellaneous – fixed typo in parser messages and other small logic/test issues.

🔋 Performance

  • TokenQueue now reuses its CharacterReader buffer, reducing allocations under heavy tokenisation.

📈 Tests & Coverage

  • Added coverage for Tag and TokenData.
  • New ksoup-network-test module with mocks.
  • Coverage for calculate-position logic.

🗑️ Deprecations & Removals

  • Removed legacy deprecated code and TODO placeholders.
  • Ktor2 APIs now deprecated – migrate to the Ktor 3 variant.

Don't miss a new ksoup release

NewReleases is sending notifications on new releases.