Skip to content

Releases: fivefilters/readability.php

v4.0.0 - 18 July 2026

Choose a tag to compare

@fivefilters fivefilters released this 18 Jul 21:35
139133c

What's Changed

Readability.php 4.0 is a ground-up rewrite: a fresh port of Mozilla's Readability.js v0.6.0 built on PHP 8.4's new DOM API and HTML parser. This is the first stable release of the 4.0 series and includes everything from v4.0.0-beta.1.

Highlights

  • PHP 8.4+ with native WHATWG parsing — parsing and serialization use Dom\HTMLDocument (the spec-compliant Lexbor parser bundled with PHP), replacing HTML5-PHP and the legacy libxml path. No more entity workarounds (substituteEntities, summonCthulhu and friends are gone).
  • Parity with Readability.js 0.6.0 — including lang and publishedTime output, maxElemsToParse, classesToPreserve, allowedVideoRegex, linkDensityModifier and debug options, and Readerable::isProbablyReaderable().
  • New result APIparse() returns a readonly Article value object (title, content, textContent, excerpt, byline, siteName, dir, lang, publishedTime, image, images, …). Options are passed as named constructor arguments: new Readability(fixRelativeURLs: true).
  • Real WHATWG URL resolution — relative URLs are fixed using PHP 8.5's native Uri\WhatWg\Url when available, with rowbot/url as the fallback on PHP 8.4, matching the new URL() behavior Readability.js relies on.
  • Tested against Mozilla's own corpus — the test suite runs Mozilla's 130 test pages verbatim, with their structural DOM comparison ported to PHP.
  • Broader dependency compatibility — constraints widened to psr/log ^1.0 || ^2.0 || ^3.0 and rowbot/url ^3.1.7 || ^4.0 so the library co-installs cleanly alongside a wider range of applications, with CI now also testing the lowest allowed versions (#49).

Upgrading from 3.x

The API has changed — see UPGRADE.md for the full migration guide, and the CHANGELOG for the complete list of changes.

Upgrading from v4.0.0-beta.1

The only changes since beta.1 are the widened dependency constraints and lowest-deps CI coverage noted above — no code changes.

Full Changelog: v3.3.3...v4.0.0

v4.0.0-beta.1 - 16 July 2026

Pre-release

Choose a tag to compare

@fivefilters fivefilters released this 16 Jul 11:40
08f80bf

What's Changed

  • v4.0: Rewrite on PHP 8.4's native DOM API, parity with Readability.js 0.6.0 by @fivefilters in #41
  • Test corpus is Mozilla's own 130 test pages, verbatim
  • See the CHANGELOG for full details and UPGRADE.md for the 3.x → 4.0 migration guide.

Full Changelog: v3.3.3...v4.0.0-beta.1

v3.3.3 - 27 April 2025

Choose a tag to compare

@fivefilters fivefilters released this 26 Apr 23:49

Fix type error - extends type support to add DOMProcessingInstruction in more method signatures (reported in
#39 by @reinierkors)

Full Changelog: v3.3.2...v3.3.3

v3.3.2 - 7 March 2025

Choose a tag to compare

@fivefilters fivefilters released this 07 Mar 18:20

Fix type error - extends type support to include DOMCdataSection and DOMProcessingInstruction in various method signatures (reported in
#37 and #38 by @mikiescolarmrf and @Grotax)

Full Changelog: v3.3.1...v3.3.2

v3.3.1 - 14 January 2025

Choose a tag to compare

@fivefilters fivefilters released this 14 Jan 12:08

What's Changed

Full Changelog: v3.3.0...v3.3.1

v3.3.0 - 29 November 2024

Choose a tag to compare

@fivefilters fivefilters released this 29 Nov 16:19
  • Fixed PHP 8.4 deprecation warning #31 (reported by @pich)
  • Migrated type declarations from PHPDoc blocks to native PHP 8 property and method types
  • Empty class attributes now removed when keepClasses is disabled
  • Replaced legacy DOM operations with native PHP 8 methods:
    • isWhitespaceInElementContent() for whitespace detection
    • firstElementChild and previousElementSibling for DOM traversal
  • Updated Docker test environment to support PHP 8.1-8.4

Full Changelog: v3.2.0...v3.3.0

v3.2.0 - 21 April 2024

Choose a tag to compare

@fivefilters fivefilters released this 21 Apr 13:36
  • Update dependencies to newer versions (League/URI version 7) to improve compatibility with projects already relying on those versions
  • Minimum PHP version set to 8.1 (required by League/URI 7)
  • Update Docker tests to use PHP 8.1, 8.2 and 8.3

Full Changelog: v3.1.7...v3.2.0

v3.1.7 - 21 April 2024

Choose a tag to compare

@fivefilters fivefilters released this 21 Apr 00:39
  • Fixes URL syntax errors when bad URLs are encountered when rewriting relative URLs - reported by @marcelklehr
  • Fixes PHP 8 deprecation notice when base URLs (used for rewriting relative URLs) don't have a path component - thanks to @blat and @Markus-GS

Full Changelog: v3.1.6...v3.1.7

v3.1.6 - 15 June 2023

Choose a tag to compare

@fivefilters fivefilters released this 15 Jun 18:09

What's Changed

  • Avoid re-parsing source HTML when making multiple attempts to identify content in parse()

Full Changelog: v3.1.5...v3.1.6

v3.1.5 - 6 April 2023

Choose a tag to compare

@fivefilters fivefilters released this 06 Apr 19:50

What's Changed

Full Changelog: v3.1.4...v3.1.5