-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
HTML links broken in markdown when they include URL fragment # #6810
Comments
Thanks for reporting! FYI, you don't need to use the [My Link](pathname:///page.html) Which treats this link as external and therefore doesn't do broken link check. |
The Is this still a bug then? Even though there is a "workaround" by using |
It is a bug. I've just sent a PR to fix it. |
Fixed in #6812! Thanks for reporting |
Hello @Josh-Cena. This referencing using pathname:/// works... But it always opens in a new tab... Is there a way to open in the same tab? I have 100s of links and don't want to send the user to new tabs everytime... Previous versions I used:
This worked like a charm before Docusaurus 3.0.0 but now I get an error for brokenlinks... It works locally though... These are my API docs (Redocly) sitting in a different folder. |
throws an error
But works locally... Worked before Docusaurus 3.0.0.
This works but opens in a new tab (which we don't want) |
@monica-m-ps for the broken anchors in 3.1 that's a new feature, and this is because the Redocly plugin (redocusaurus?) does not use the new API to report existing heading ids it creates. See https://docusaurus.io/blog/releases/3.1#broken-anchors-checker Let's track this in rohit-gohri/redocusaurus#321 Until then you can disable with For the opening in new tabs, please open a dedicated issue and create a runnable repro using docusaurus.new |
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
When embedding a HTML
a
tag links in markdown and the path includes a URL fragment (anchor), then the production build fails saying that the link is broken.For some reason, there is no error when in hot reload mode (
npm start
); although hot reload mode might just be designed to ignore these kinds of errors?Markdown file:
Static HTML page:
The static HTML page contains an anchor named "anchor" which I should be able to link to from the markdown.
If I remove the anchor from the link:
Then, there is no broken link. Even though the build is correctly resolving to
/page.html
in both cases.Reproducible demo
https://stackblitz.com/edit/github-jgvs2v?devtoolsheight=33&file=docs/broken.md
Steps to reproduce
npm run build
Expected behavior
No broken link. Static page exists with correct anchor.
Actual behavior
The production build fails with broken links.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: