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

fix(mdx-loader): resolve Markdown/MDX links with Remark instead of RegExp #10168

Merged
merged 11 commits into from
May 24, 2024

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented May 23, 2024

Motivation

Implement proper resolution of Markdown links ([title](./file.md))

We process the AST with Remark instead of a raw string with complex RegExp that don't understand well HTML/MDX comments, code blocks, etc...

Fix #9048

Note:

  • The link resolution algo has been kept exactly as before
  • This change does not seem to have a significant perf impact (I expected a possible improvement)

Test Plan

Unit tests + dogfooding (all links on our website should keep resolving as before + new fancy cases added from the initial issue)

Test links

https://deploy-preview-10168--docusaurus-2.netlify.app/

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 23, 2024
@slorber slorber requested a review from Josh-Cena as a code owner May 23, 2024 17:02
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 23, 2024
Copy link

github-actions bot commented May 23, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 67 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 66 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 74 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 69 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 62 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 70 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 76 🟢 100 🟢 100 🟢 90 🟠 88 Report

Copy link

netlify bot commented May 24, 2024

[V2]

Name Link
🔨 Latest commit ebe2aef
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6650c491299bf30008d98f3a
😎 Deploy Preview https://deploy-preview-10168--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

github-actions bot commented May 24, 2024

Size Change: +2.56 kB (+0.15%)

Total Size: 1.72 MB

Filename Size Change
website/.docusaurus/globalData.json 107 kB +359 B (+0.34%)
website/.docusaurus/registry.js 276 kB +547 B (+0.2%)
website/.docusaurus/routes.js 180 kB +522 B (+0.29%)
website/.docusaurus/routesChunkNames.json 119 kB +220 B (+0.18%)
website/build/assets/js/main.********.js 855 kB +916 B (+0.11%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 26.9 kB
website/.docusaurus/i18n.json 930 B
website/.docusaurus/site-metadata.json 2.17 kB
website/build/assets/css/styles.********.css 112 kB
website/build/index.html 38.1 kB

compressed-size-action

@slorber slorber added the Argos Add this label to run UI visual regression tests. See argos.yml GH action. label May 24, 2024
Copy link

argos-ci bot commented May 24, 2024

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 24, 2024, 4:54 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Argos Add this label to run UI visual regression tests. See argos.yml GH action. 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.

MDX loader: linkify should process the md AST instead of the md string
2 participants