-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown links to markdown files will be broken if the file name does not contain space but is surrounded by <> #9614
Comments
I've tried to create a repro here Indeed link surrounded by edit: Links with spaces will only work with |
I checked this reproduction and these two links work on my end, which is the expected behaviour? The second link looks weird in the editor though.
|
hmmm 🤔 I thought we fixed this bug in #8867 but apparently it's back despite unit tests? Need to be investigated |
I think the regex only matches links with both |
It was replaced by a plethora of big regexps which I found it powerful enough by looking at it while realising at the same time I am too stupid to comprehend it docusaurus/packages/docusaurus-utils/src/markdownLinks.ts Lines 123 to 137 in 8dd1e13
Test shows that it could detect some but not all of similar cases: |
@axmmisaka I've submitted a PR: #9617 The regex evolved over time. Now it's probably not a good idea to reason it from scratch😅 |
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
Per CommonMark,
[Haha](../hehe.mdx)
and[Haha](<../hehe.mdx>)
should be the same (if the path to file contains space only the latter will work, nevertheless.)In Docusaurus 3, if the file path contains space only the latter syntax will work; however, if the file path does not contain space, only the former syntax will work and the latter will result in broken link.
Reproducible demo
No response
Steps to reproduce
docs/tutorial-basics/congratulations.md
,yarn build
Expected behavior
As if nothing has changed
Actual behavior
Broken links found
Your environment
Self-service
The text was updated successfully, but these errors were encountered: