helpers: url() rejects a resolved URL whose path has an apostrophe
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
Research direction
Read the url() helper and its isUrl validation in @metascraper/helpers, then inspect packages/metascraper-helpers/test/index.js. Add a test resolving a relative path against a page URL containing an apostrophe, and check that the resolved URL is returned; the issue is done when that case passes.
Written by the indexing model from the issue text.
Description
What happens
url() in @metascraper/helpers returns undefined for any relative value resolved against a page whose path contains ', so every relative image, logo or url on that page is dropped.
const { url } = require('@metascraper/helpers')
url('thumbs/DSCF0203.jpg', {
url: "https://espagne.seville.af24.fr/L'alcazar/Palais%20du%20Roi%20Pedro/index.html"
})
// => undefined
new URL() resolves it fine (https://espagne.seville.af24.fr/L'alcazar/Palais%20du%20Roi%20Pedro/thumbs/DSCF0203.jpg), but isUrl (url-regex-safe, exact: true) rejects the ', which RFC 3986 allows in a path (sub-delims).
Who gets it
Found while fixing #899: on that page the real image (data-src="thumbs/DSCF0203.jpg", also src once rendered) is rejected, while ../../res/blank.png resolved outside the apostrophe segment and was returned. With #899 fixed the page answers image: null instead of the real thumbnail.
Done when
url() keeps a resolved URL with ' in its path, with a test in packages/metascraper-helpers/test/index.js.
🤖 Generated with Claude Code
- Dominant language
- HTML
- Stars
- 2.8k
- Forks
- 183
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from microlinkhq/metascraper
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microlinkhq/metascraper#905 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
microlinkhq/metascraper#903 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
microlinkhq/metascraper#909 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
microlinkhq/metascraper#908 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
microlinkhq/metascraper#906 ·
Maintainers usually reply within 1 day
All issues in microlinkhq/metascraper
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ranxianglei/billion-context#8319 ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
nolte/kamerplanter#3193 ·
Maintainers usually reply within 1 day
-
bug documentation queries
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ClickHouse/clickhouse-cs#815 ·
Maintainers usually reply within 1 day
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day