Skip to content

Aria-label improvements for links that open in a new tab. #11547

@CambodianCoder

Description

@CambodianCoder

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

Links that open in a new tab don't respect the existing label field specified in the docusaurus config file.
Please refer to #11331 (comment) for more details.

Reproducible demo

No response

Steps to reproduce

Create a link in the docusaurus config file that doesn't have a "to" field, indicating it should open in a new tab.

Expected behavior

The supplied label is used, along with the text "(Opens in a new tab.)", in the aria-label.

Actual behavior

The supplied label was not used in the aria-label.

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executionstatus: needs triageThis issue has not been triaged by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions