Skip to content

Alternative Text for Images in titles #8393

Description

@rachfop

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

Looks like there is a bug with how docusaurus renders alternate texts placed in titles.
But if you have a title with an image and alias:
## ![Run the Application](/img/icons/run.png) Run the Application
The title is duplicated in the sidebar.
This unfortunate because images should have alternate text (alt text) for accessibility.

Reproducible demo

No response

Steps to reproduce

  1. Create a title with an svg or image
  2. Provide alt text in the image
  3. Look at the side bar

Expected behavior

Alt text shouldn't appear in the side bar.

Actual behavior

Screenshot 2022-11-29 at 2 06 40 PM

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

    closed: working as intendedThis issue is intended behavior, there's no need to take any action.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions