j0k3r / php-readability

A fork of https://bitbucket.org/fivefilters/php-readability
Apache License 2.0
165 stars 36 forks source link

Readability 3.0 #81

Open jtojnar opened 1 year ago

jtojnar commented 1 year ago

Some BC breaking suggestions:

Kdecherf commented 1 year ago

@jtojnar could you elaborate on 4th and 6th items?

jtojnar commented 1 year ago

Sure. I am not sure how feasible these are, though.

Decouple Readability (stateless worker object) from result

I was thinking something like making Readability a factory for an immutable ReadableArticle data object. That way it should be harder to have internally inconsistent state like in https://github.com/j0k3r/graby/pull/307

Drop JSLikeHTMLElement in favour of static functions

registerNodeClass is hard to make work with static analysis – we could just create getInnerHtml(DOMElement): string function and use that instead ->innerHTML magic property.