Skip to content

v3 regression: broken link if the first url has a anchor and the second url is in parenthesis #9553

Closed as not planned

Description

@hasezoey

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

with docusaurus 3.0.0 a url is broken if the first url has a anchor ([a](./file.md#anchor)) and the second url uses the same url, but is in parenthesis (([b](./file.md#anchor])), fuller example:

[a](./migration/migrate-6.md#hooks) ([b](./migration/migrate-6.md#hooks))

this does not occur if no parenthesis are used:

[a](./migration/migrate-6.md#hooks) [b](./migration/migrate-6.md#hooks)

or if the first url does not have a anchor:

[a](./migration/migrate-6.md) ([b](./migration/migrate-6.md#hooks))

PS: removing (or changing) the "id:" in the target file does not change the error

Reproducible demo

https://github.com/typegoose/typegoose/tree/docusuaursV3urlError

Steps to reproduce

  1. clone the repo (and checkout the the branch docusuaursV3urlError)
  2. cd into website/
  3. run yarn install
  4. run yarn run build
  5. observe 2 errors:
  • once for /typegoose/docs/guides/advanced/reference-other-classes - which is the original case where i first saw the error
  • once for /typegoose/docs/guides/error-warning-details - which is a reproduction of the issue

Expected behavior

the url to successfully compile with a correct link like in 2.4.3

Actual behavior

Broken link at runtime, and on build a broken link error:

Error: Unable to build website for locale en.
    at tryToBuildLocale (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/commands/build.js:55:19)
    at mapAsyncSequential (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/utils/src/jsUtils.ts:45:20)
    at async Command.build (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/commands/build.js:82:21) {
  [cause]: Error: Docusaurus found broken links!
  
  Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
  Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.
  
  Exhaustive list of all broken links found:
  
  - On source page path = /typegoose/docs/guides/advanced/reference-other-classes:
     -> linking to ../../api/functions/typeguards/isDocument.md#isdocumentarray (resolved as: /typegoose/docs/api/functions/typeguards/isDocument.md)
  
  - On source page path = /typegoose/docs/guides/error-warning-details:
     -> linking to ./migration/migrate-6.md#hooks (resolved as: /typegoose/docs/guides/migration/migrate-6.md)
  
      at throwError (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/logger/src/index.ts:135:9)
      at handleBrokenLinks (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/server/brokenLinks.js:153:47)
      at async buildLocale (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/commands/build.js:192:5)
      at async tryToBuildLocale (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/commands/build.js:46:20)
      at mapAsyncSequential (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/utils/src/jsUtils.ts:45:20)
      at async Command.build (/mnt/projects/nodejs/typegoose/website/node_modules/@docusaurus/core/lib/commands/build.js:82:21)
}

[INFO] Docusaurus version: 3.0.0
Node version: v21.1.0

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Activity

  1. added
    bug
    status: needs triage
    on Nov 15, 2023
  2. added
    domain: markdown
    and removed
    status: needs triage
    on Nov 15, 2023
  3. Josh-Cena commented on Nov 15, 2023

    @Josh-Cena
    Collaborator

    I think this is a duplicate of #9518. We'll make sure we fix both. Thanks for the detailed investigation!

  4. added
    closed: duplicate
    domain: markdown
    and removed
    domain: markdown
    on Nov 15, 2023
  5. slorber commented on Apr 25, 2024

    @slorber
    Collaborator

    The issue to track for resolution of this bug is now #9048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclosed: duplicatedomain: markdown

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions