Excerpt detection sometimes picks irrelevant first paragraph

Open
#651 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
content

Research direction

Start by locating the excerpt-detection logic and the mercurial testcase mentioned in the issue. Reproduce the case where the first paragraph is "Contents", then add a regression test showing that an irrelevant short paragraph is skipped in favor of a relevant later paragraph; the accepted length and paragraph limits still need to be decided.

Written by the indexing model from the issue text.

Description

has-website-testcase metadata

(originally mentioned in #646)
Excerpt detection works the way that if it doesn't pick it from meta it takes first paragraph. But in some cases the first paragraph is not relevant for excerpt. eg. in testcase mercurial it contains only text "Contents".
I would suggest to test the taken paragraph for length and say that to be considered relevant it should be longer than X (eg. 15) words and be one of first Y (eg. 3) paragraphs.

Dominant language
JavaScript
Stars
11.5k
Forks
732
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/readability

All issues in mozilla/readability

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.