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

docs: suggest using {<...>...</...>} if don't use Markdown in migra… #10167

Merged
merged 1 commit into from
May 27, 2024

Conversation

tats-u
Copy link
Contributor

@tats-u tats-u commented May 23, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

If you want to migrate complex JSX expressions in MDXv1 + Docusaurus v1/2 to MDXv3 + Docusaurus v3, you can just wrap them with {...}.
You can't use Markdown syntax there (as before), but don't have to care about the extra insertion of <p> elements.
This will help you if you have to migrate documents that have complex JSX expressions that you don't want to touch.

MDX v1

<Foo>
  <Bar>
     <Baz>
        You don't have to care about extra <code>&lt;p&gt;</code> here!<Qux/>
     </Baz>
  </Bar>
  <Corge>
    **no emphasis**
  </Corge>
</Foo>

MDX v2 & 3

{<Foo>
  <Bar>
     <Baz>
        You don't have to care about extra <code>&lt;p&gt;</code> here!<Qux/>
     </Baz>
  </Bar>
  <Corge>
    **no emphasis**
  </Corge>
</Foo>}

Test Plan

https://deploy-preview-10167--docusaurus-2.netlify.app/docs/migration/v3#unintended-extra-paragraphs
https://deploy-preview-10167--docusaurus-2.netlify.app/docs/3.3.2/migration/v3/#unintended-extra-paragraphs

Test links

Deploy preview: https://deploy-preview-10167--docusaurus-2.netlify.app/

Related issues/PRs

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 23, 2024
Copy link

netlify bot commented May 23, 2024

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 1585d9a
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/664f544f4a90280007a37544
😎 Deploy Preview https://deploy-preview-10167--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🔴 40 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 59 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 64 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 64 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 67 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 77 🟢 100 🟢 100 🟢 90 🟠 88 Report

@slorber slorber added the pr: documentation This PR works on the website or other text documents in the repo. label May 27, 2024
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks 👍

@slorber slorber merged commit 6c7f2fd into facebook:main May 27, 2024
13 checks passed
@tats-u tats-u deleted the mdx3-jsx branch May 27, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants