Skip to content

Relative markdown links contain file extensions #10152

@serpro69

Description

@serpro69

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

I'm following the 5-minute tutorial and discovered that relative file paths are not converted to links (the file extension is not removed from the link, and hence results in 404)

Reproducible demo

https://codesandbox.io/p/sandbox/winter-pine-527qpc

Steps to reproduce

  • create docs/foo.md and docs/bar.md files
  • Link to bar.md from foo.md:
Link to [bar](./bar.md)
  • Open foo page and click on the link

Expected behavior

bar page should open at .../docs/bar

Actual behavior

the url contains file extension, i.e. .../docs/bar.md

Your environment

  • Public source code: n/a (I've just initialized a new project with docusaurus and following the tutorial)
  • Public site URL: n/a
  • Docusaurus version used: 3.2.2
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): node v18.16.1
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Ubuntu 22.04

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions