-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Reference-style Markdown links are not resolved #6616
Comments
Hey, we do allow writing Markdown links, and they are documented in multiple places, e.g. https://docusaurus.io/docs/docs-markdown-features#referencing-other-documents Your issue is that you are using the reference-style Markdown link, while we have a faulty regex that only permits one space between the colon and the text. I will fix that. This style isn't common, so we haven't had people complaining so far...🤦♂️
Not always. It's up to the individual plugin to convert file paths to URLs, and plugins as of now don't communicate with each other, so the docs plugin can't know the file -> URL mapping of the blog plugin. Therefore, you can't write a link to a doc Markdown file in a blog file. See #6370 for a potential solution |
Wow that explains my "randomly" comment... My links section actually looked like this: [info]: ../api/classes/divine_uri.URI.md#info
[list]: ../api/classes/divine_uri.URI.md#list
[load]: ../api/classes/divine_uri.URI.md#load
[save]: ../api/classes/divine_uri.URI.md#save
[append]: ../api/classes/divine_uri.URI.md#append
[remove]: ../api/classes/divine_uri.URI.md#remove
[query]: ../api/classes/divine_uri.URI.md#query
[watch]: ../api/classes/divine_uri.URI.md#watch and the Thanks! |
Yes, see the fix I just made. Our faulty regex only allows one space in between. You can try with the latest canary. |
Just FYI my links now work using |
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
I'm editing my Markdown files in VS Code, and it's very handy to be able to click on Markdown links in VS Code to automatically open the linked Markdown source file when editing, if not just to make sure the link works.
To do this, I need to link to the actual Markdown file. However, Docusaurus will not allow this when running
docusaurus build
and when runningdocusaurus start
, the it randomly (!?) strips or retains the.md
extension (!?).You obviously know that the file
docs/my/text.md
will end up at path/docs/my/text
so why can't Markdown links go through the same resolution step, so we can easily navigate source code links while editing?Steps to reproduce
Expected behavior
The links all navigate to
/docs/api/divine_uri.URI
.Actual behavior
The links all navigate to
/docs/api/divine_uri.URI.md
, which is a 404.Your environment
Reproducible demo
No response
Self-service
The text was updated successfully, but these errors were encountered: