[bug] Single word Wikipedia headers are removed while multiple words are parsed
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 732
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
For context, this is an issue I noticed on my karakeep instance, a FOSS bookmarking solution. I opened an issue there and was told the bug might be on readability's side. So I opened firefox, opened the webpage and indeed confirmed the bug is caused by readability.
Describe the Bug
I noticed that saving wikipedia pages to karakeep would sometimes miss the section headers.
I finally figured out how to reproduce this: headers that are only a single world are always removed whereas those that span over multiple words are kept.
This might happen outside of wikipedia too but I can't know what I'm missing.
Steps to Reproduce
- On firefox, go to German tank problem.
- Notice its table of content and how some sections are single words like
Suppositionswhile others are over multiple words likeHistorical example of the problem.
- Open readability on that page
- Search each of the table of content section headers. Presents are
Historical example of the problem,Frequentist analysisandBayesian Analysis. AlsoSee also,Further readingandExternal links. Missing are:Suppositions,Example,Countermeasures,NotesandReferences. - Notice that the common feature of the missing title is the fact that they are single words.
Expected Behaviour
All headers should be kept.
Screenshots or Additional Context
Here is the table of content:
And here notice the missing Suppositions section header:
But other section headers do exist:
Device Details
No response
Exact Firefox Version
144.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the German tank problem Wikipedia page in Firefox and compare the retained and missing section headers. Trace the header parsing and filtering behavior responsible for single-word titles; done means all listed headers, including Suppositions, Example, and References, are retained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100