Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta: Improve results on Readability.js test suite #61

Open
3 tasks
vkryukov opened this issue Nov 12, 2024 · 2 comments
Open
3 tasks

Meta: Improve results on Readability.js test suite #61

vkryukov opened this issue Nov 12, 2024 · 2 comments

Comments

@vkryukov
Copy link
Contributor

vkryukov commented Nov 12, 2024

While readability has a reasonable test suite, it pales in comparison to Readability.js test suite with its 124 test cases.

With the help of a small Elixir program, we're going to discover main differences in behavior between us and them. This issue will serve as a Meta issue to keep track of all bug fixes and reasonable improvement opportunities.

@Valian
Copy link
Collaborator

Valian commented Nov 12, 2024

The best approach would be to "steal" test suite from readability and try to make it pass with an Elixir version 🤔 It would require quite a lot of changes to the underlying implementation, but should be possible.

@vkryukov
Copy link
Contributor Author

I agree - ideally, we would just use their test suite unchanged (or programmatically modified) as part of readability test suite.

There would be a few challenges, though: for example, they wrap their results in <div id="readability-page-1" class="page">, they keep the full page, including the title, with the current readability's logic removes from the page, h1 in the input sometimes becomes h2 in the output.

My current approach was to use it for inspiration to find new bugs and edge case, and than manually add (possibly adjusted) tests to improve our own test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants