Skip to content

Commit

Permalink
fix: ignore pypi /packages/source/v/ url (#88)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
baruchiro authored May 30, 2023
1 parent fa259f2 commit 072677b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/content/registry/python.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createParseCommand } from './shared';

const registryParser = ({ pathname }) => {
if (pathname.includes('/packages/source/v/')) return;

const [_empty, _part, name, version] = pathname.split('/');
return {
type: 'pypi',
Expand Down
5 changes: 1 addition & 4 deletions src/content/stackoverflow/finder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ describe(findRanges.name, () => {
it.each(['http://npmjs.org/', 'https://pypi.python.org/packages/source/v/virtualenv/virtualenv-12.0.7.tar.gz'])(
`Should not find any package in '%s'`,
(url) => {
const body = document.createElement('body');
const a1 = document.createElement('a');
a1.href = url;
body.appendChild(a1);
const { body } = createRealAnswer(`<a id="test" href="${url}">test</a>`);

const foundElements = findRanges(body);

Expand Down

0 comments on commit 072677b

Please sign in to comment.