alan-turing-institute / alan-turing-institute/ReadabiliPy

Error in Readability.js ?

Open
#111 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
359
Forks
44
PR merge metrics
No merged PRs in 30d

Description

I'm using readabilitpy 0.2.0 and I've found what I think is an error. In file Readability.js, in line 1227, there is the line:

values[name] = content.trim();

But content can be empty and it will produce an error.
I've solved it in line 1219, adding a check for content:

if (elementProperty && content) {

But I'm not sure if it is the correct way to deal with the issue. I can send a PR if this is ok.

Best regards, thank you and keep up the good work!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting Readability.js around lines 1219 and 1227, where elementProperty and content are handled before content.trim() is called. Reproduce the empty-content case and confirm that the chosen guard prevents the error without changing normal extraction behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.