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

Can't swizzle Admonition #7478

Closed
7 tasks done
EmaSuriano opened this issue May 24, 2022 · 2 comments · Fixed by #7152
Closed
7 tasks done

Can't swizzle Admonition #7478

EmaSuriano opened this issue May 24, 2022 · 2 comments · Fixed by #7152
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: markdown Related to Markdown parsing or syntax

Comments

@EmaSuriano
Copy link

EmaSuriano commented May 24, 2022

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

Hello I'm using trying to replace completely the component of Admonition because I would like to use my design system to replace these components. I'm using the command swizzle to eject/wrap the component in order to replace it, but it seems that it's not making any change.

image

Reproducible demo

https://codesandbox.io/s/priceless-dream-tovkeh?file=/src/theme/Admonition/index.js

Steps to reproduce

  1. Create fresh project
  2. Run yarn swizzle and select Admonition to be ejected.
  3. Make any change to the ejected component.

Expected behavior

The content of the Admonition should be the one return by the ejected component.

Actual behavior

Changes on the ejected component are ignored.

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@EmaSuriano EmaSuriano 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 May 24, 2022
@Josh-Cena
Copy link
Collaborator

Hello, this is because the admonition is created with an external remark plugin, which directly generates markup, instead of proxying it to @theme/Admonition. This will be fixed by #7152.

@Josh-Cena Josh-Cena added domain: markdown Related to Markdown parsing or syntax and removed status: needs triage This issue has not been triaged by maintainers labels May 24, 2022
@EmaSuriano
Copy link
Author

EmaSuriano commented May 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: markdown Related to Markdown parsing or syntax
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants