Escaped Markdown links with spaces in them are not routed correctly #8867
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
good first issue
If you are just getting started with Docusaurus, this issue should be a good place to begin.
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Links that contain spaces have to be enclosed in pointy brackets (
<>
) according to the CommonMark specification (see here). In Docusaurus, the links are displayed properly, but are routed to the original filename (i.e. they also keep the original file extension). A link such as[Link](<./file 1.md>)
will go tohttps://<yourwebsitehere>/<yourpathhere>/file%201.md
ifonBrokenLinks
is set towarn
and will completely fail the build process otherwise.Reproducible demo
https://vladnastase.github.io/docusaurus-bug/chapter1/doc
Steps to reproduce
onBrokenLinks
towarn
indocusaurus.config.js
.Expected behavior
Build succeeds if
onBrokenLinks
is not set towarn
, link works properly otherwise.In the linked reproduction, links 2 and 3 should go to
https://vladnastase.github.io/docusaurus-bug/chapter1/doc%202
andhttps://vladnastase.github.io/docusaurus-bug/chapter%202/doc1
respectively (instead ofhttps://vladnastase.github.io/docusaurus-bug/chapter1/doc%202.md
andhttps://vladnastase.github.io/docusaurus-bug/chapter%202/doc1.md
)Actual behavior
Build fails if
onBrokenLinks
is not set towarn
, links don't work properly (they keep the original file extension).Your environment
Self-service
The text was updated successfully, but these errors were encountered: