Skip to content

Fix links to local directories with dots#12023

Open
LeSingh1 wants to merge 1 commit into
facebook:mainfrom
LeSingh1:fix-dotted-directory-links
Open

Fix links to local directories with dots#12023
LeSingh1 wants to merge 1 commit into
facebook:mainfrom
LeSingh1:fix-dotted-directory-links

Conversation

@LeSingh1
Copy link
Copy Markdown

Summary

Fixes local Markdown links to existing directories whose names contain dots, such as:

[dir](../directory-with.dot/)

Previously, this path was treated as asset-like because path.extname('../directory-with.dot/') returns .dot. Since the directory exists, the MDX link transform attempted to emit an asset require() for the directory, which caused the Docusaurus build to fail.

This change keeps existing asset behavior intact while treating existing local directories as links instead of assets.

Fixes #11940.

Test Plan

npx vitest run packages/docusaurus-mdx-loader/src/remark/transformLinks
npx vitest run packages/docusaurus-mdx-loader

Both pass. Formatting (oxfmt) is clean.

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label May 15, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 1cc9cf7
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a06c24fbe19b30007c7d2c1
😎 Deploy Preview https://deploy-preview-12023--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 project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links to local directories with dots in filename break docusaurus build

1 participant