mozilla / mozilla/readability

Trailing slash added to urls in href when using linkedom

Open
#980 2 comments 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

Using standalone readability, version 0.6.0. Using the following minimal example:

<!DOCTYPE HTML">
<html>
<body>
<a href="https://www.debian.org/security/faq">https://www.debian.org/security/faq</a>
</body>
</html>

The string is parsed into a document using linkedom version 0.18.12. Inspecting the Node objects show the href as expected, without a slash.

Creating a new readability object and using the parse method however, generates an object with the href url having a newly added trailing slash. In this example, such a change leads to a 404 not found exception.

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

Run the minimal HTML example with standalone Readability 0.6.0 and linkedom 0.18.12, comparing the parsed Node href with the href produced by Readability.parse. Trace where parse changes the URL, and verify that the original href remains unchanged so the example does not lead to a 404.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.