Skip to content

Commit 072677b

Browse files
authored
fix: ignore pypi /packages/source/v/ url (#88)
Should ignore (or support in another way) links of type: https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz (cherry picked from commit 9d035c0)
1 parent fa259f2 commit 072677b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/content/registry/python.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { createParseCommand } from './shared';
22

33
const registryParser = ({ pathname }) => {
4+
if (pathname.includes('/packages/source/v/')) return;
5+
46
const [_empty, _part, name, version] = pathname.split('/');
57
return {
68
type: 'pypi',

src/content/stackoverflow/finder.test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ describe(findRanges.name, () => {
5151
it.each(['http://npmjs.org/', 'https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz'])(
5252
`Should not find any package in '%s'`,
5353
(url) => {
54-
const body = document.createElement('body');
55-
const a1 = document.createElement('a');
56-
a1.href = url;
57-
body.appendChild(a1);
54+
const { body } = createRealAnswer(`<a id="test" href="${url}">test</a>`);
5855

5956
const foundElements = findRanges(body);
6057

0 commit comments

Comments
 (0)