Strip .md extension
CoreCreatedJun 1, 2026Takeshi Takatsudo
Removes the .md or .mdx suffix from internal link hrefs at build time.
StripMdExtensionPlugin removes the .md or .mdx suffix from internal
link href values so that links authored as [page](. produce
clean output URLs like /.
What it does
In the hast phase, the plugin walks every <a> element. For each link whose
href ends with .md or .mdx:
- Strips the extension.
- Leaves the rest of the path, query string, and fragment intact.
The plugin only touches relative and root-relative paths — absolute URLs
(https:) and non-link elements are left unchanged.
Config
Always on when a source map is available, no config key. The plugin runs
after ResolveLinksPlugin so it sees the already-resolved paths.
Example
See [setup](./installation.mdx) for details.
Produces:
<a href="./installation">See setup for details.</a>
See also
- Resolve links — runs before this plugin to normalise the target path.