Repository navigation
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
If a markdown link spans more than one line, the filepath-to-urlpath conversion mentioned here (https://docusaurus.io/docs/markdown-features/links) does not work.
There's a CodeSandbox repro below, which effectively shows:
<!-- This works, turning the link into "other-page" -->
A [link to another page](other-page.md)
<!-- This doesn't work, the link stays "other-page.md" -->
A [link to
another page](other-page.md)
Splitting link text across lines is valid markdown. It doesn't seem like formatting with prettier breaks link text across multiple lines (i.e. to obey a line width limit), but other tools do, which can lead to this issue unexpectedly breaking the link without any sort of error or warning.
Reproducible demo
Steps to reproduce
- Visit the CodeSandbox link above
- Click on the "Demo" link in the top navbar of the browser pane
- Both "First link" and "Second link" link to
other-page.md, but only the first is converted to point to /docs/other-page
Expected behavior
The markdown loader should convert relative links to files into url paths, regardless of the formatting of the link text.
Actual behavior
Relative links to files are not converted into url paths if the link text spans multiple lines.
Your environment
- Public source code: https://codesandbox.io/p/devbox/stupefied-mclaren-55crfh
- Docusaurus version used: 3.0.1
Self-service
- I'd be willing to fix this bug myself.
Activity
slorber commentedon Dec 16, 2023
Duplicate of #9523
Will be handled as part of #9048