[bug] Single word Wikipedia headers are removed while multiple words are parsed
Hi,
For context, this is an issue I noticed on my [karakeep](https://github.com/karakeep-app/karakeep) instance, a FOSS bookmarking solution. I opened an issue [there](https://github.com/karakeep-app/karakeep/issues/2021) 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
1. On firefox, go to [German tank problem](https://en.wikipedia.org/wiki/German_tank_problem).
2. Notice its table of content and how some sections are single words like `Suppositions` while others are over multiple words like `Historical example of the problem`.
<img width="176" height="349" alt="Image" src="https://github.com/user-attachments/assets/04b3ac8d-5e40-4072-baf4-fbf11b3a86c1" />
3. Open readability on that page
4. Search each of the table of content section headers. Presents are `Historical example of the problem`, `Frequentist analysis` and `Bayesian Analysis`. Also `See also`, `Further reading` and `External links`. Missing are: `Suppositions`, `Example`, `Countermeasures`, `Notes` and `References`.
5. 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:
<img width="350" height="635" alt="Image" src="https://github.com/user-attachments/assets/c2ba251d-8584-4092-b0f6-8a3f2b732c5c" />
And here notice the missing `Suppositions` section header:
<img width="1148" height="537" alt="Image" src="https://github.com/user-attachments/assets/8e9db475-1c47-4e9f-939e-5eabdd616452" />
<img width="642" height="507" alt="Image" src="https://github.com/user-attachments/assets/5ef8e91a-d753-4a68-9a9a-4426bfd85449" />
But other section headers do exist:
<img width="642" height="591" alt="Image" src="https://github.com/user-attachments/assets/4a0d009b-fc2e-4462-914e-45b5dea6fcbe" />
### Device Details
_No response_
### Exact Firefox Version
`144.0`
1 条评论