mozilla / mozilla/readability

Readability strips out too much HTML, breaking anchor links

Open
#963 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The URL in question: https://practicaltypography.com/are-two-spaces-better-than-one.html

The source HTML looks like this:

<p>
    ...
    <a href="#update-august-2022">
        2022 up­date
        ::after
    </a>
    ...
</p>
...
<div class="subhead" id="update-august-2022">
    <a href="#update-august-2022">Update, August 2022</a>
</div>

After Readability it looks like this:

<p>
    ...
    <a class="no-href" href="#update-august-2022">
         2022 up­date
    </a>
    ...
</p>
...

i.e. the anchor link destination has been stripped out and so the href no longer works.

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.

Research direction

Start by running the provided practicaltypography.com URL through Readability and comparing the source and processed HTML around the anchor and its target. Trace the handling of same-page links, then verify that the processed anchor retains a working href to the existing update-august-2022 destination.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.