Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOC items don't show words when they come from components #10017

Closed
6 of 7 tasks
plocket opened this issue Apr 4, 2024 · 2 comments
Closed
6 of 7 tasks

TOC items don't show words when they come from components #10017

plocket opened this issue Apr 4, 2024 · 2 comments
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@plocket
Copy link

plocket commented Apr 4, 2024

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

The table of contents menu seems to ignore the text of components, though the regular text nodes of the same heading are visible.

There is probably an issue for this already, but I couldn't find it.

Reproducible demo

https://codesandbox.io/p/devbox/reverent-hamilton-m5y9nl

Steps to reproduce

  1. Make a component
  2. Import it
  3. Use it in a heading
  4. See that the text is visible in the heading
  5. Check the table of contents and see that the component's text is not there

Expected behavior

I thought the text of the component that is in the heading would be visible in the table of contents.

Actual behavior

The text of the component is missing from the table of contents, though the other text in the heading is visible.

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@plocket plocket added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 4, 2024
@Abdullah-03
Copy link
Contributor

Similar to #10018. TOC does not handle JSX.

@Josh-Cena
Copy link
Collaborator

Calling it a duplicate of #9772

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
@Josh-Cena Josh-Cena added closed: duplicate This issue or pull request already exists in another issue or pull request and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants