Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: allow html syntax in MDX v2 with format md #8960

Merged
merged 11 commits into from
May 12, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented May 4, 2023

Motivation

Current MDX 2 setup does not allow arbitrary HTML elements when using format md (ie when using .md file extension)

Related: I am contributing new useful options to the MDX playground because otherwise this is not simple to debug how this new md format works: mdx-js/mdx#2295

Note: this PR refactors many things to cleanup our MDX setup, but overall the solution to this specific html embed problem was:

[
      rehypeRaw,
      {
        passThrough: [
          'mdxFlowExpression',
          'mdxJsxFlowElement',
          'mdxJsxTextElement',
          'mdxTextExpression',
          'mdxjsEsm',
        ],
      },
    ];

Test Plan

preview should render fine

Test links

https://deploy-preview-8960--docusaurus-2.netlify.app/tests/pages/markdown-tests-md

CleanShot 2023-05-11 at 19 50 13

Related issues/PRs

#8469 (reply in thread)

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 4, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 4, 2023
@netlify
Copy link

netlify bot commented May 4, 2023

[V2]

Name Link
🔨 Latest commit 516a1de
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/645d2b143c76c40007af474f
😎 Deploy Preview https://deploy-preview-8960--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 settings.

@github-actions
Copy link

github-actions bot commented May 4, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 65 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 81 🟢 100 🟢 92 🟢 100 🟠 89 Report

@github-actions
Copy link

github-actions bot commented May 4, 2023

Size Change: 0 B

Total Size: 1.01 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 101 kB
website/build/assets/css/styles.********.css 113 kB
website/build/assets/js/main.********.js 752 kB
website/build/index.html 41.3 kB

compressed-size-action

@slorber slorber marked this pull request as ready for review May 11, 2023 17:51
@slorber slorber requested review from lex111 and Josh-Cena as code owners May 11, 2023 17:51
@slorber slorber merged commit 07ad635 into main May 12, 2023
@slorber slorber deleted the slorber/mdx-format-md-embed-html branch May 12, 2023 09:36
This was referenced Oct 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants