diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1ce25d..958de42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 2 submodules: recursive - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: 20.x - run: npm install @@ -28,12 +28,12 @@ jobs: node: ['18', '20', '22'] name: Testing on node ${{ matrix.node }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 2 submodules: recursive - name: Setup Node.js environment - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'npm' diff --git a/src/index.spec.ts b/src/index.spec.ts index 4153a1e..146bac8 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -115,6 +115,16 @@ describe('external DOI links', () => { 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v2', '10.1101/2020.11.02.364968', ], + [ + 'biorxiv', + 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v1.full', + '10.1101/2020.11.02.364968', + ], + [ + 'biorxiv', + 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v23.article-metrics', + '10.1101/2020.11.02.364968', + ], ])('Test %s (%s) <%s>', (_, url, doiString) => { expect(doi.normalize(url)).toBe(doiString); expect(doi.validate(url)).toBe(doiString ? true : false); diff --git a/src/resolvers.ts b/src/resolvers.ts index b48b77f..891553d 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -45,7 +45,7 @@ const biorxiv: Resolver = { parse(url) { return clumpParts(url) .find(validatePart) - ?.replace(/v([\d]*)$/, ''); + ?.replace(/v\d+(\.[a-zA-Z-]+)?$/, ''); }, };