Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved link inside HTML comment #5659

Closed
4 of 5 tasks
KyrietS opened this issue Oct 7, 2021 · 3 comments
Closed
4 of 5 tasks

Unresolved link inside HTML comment #5659

KyrietS opened this issue Oct 7, 2021 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request

Comments

@KyrietS
Copy link
Contributor

KyrietS commented Oct 7, 2021

馃悰 Bug Report

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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

I get an error when I build the website:

Docs markdown link couldn't be resolved: (somepage.md) in {path}/mypage.md for version current

mypage.md looks like this:

# title
<!-- [some page](somepage.md) -->

Have you read the Contributing Guidelines on issues?

Yes.

Steps to reproduce

Add to any markdown page:

<!-- [some text](nonexistentpage.md) -->

Expected behavior

Dummy links in HTML comments should not produce any warning / error during build.

Actual behavior

Docusaurus thinks that markdown link cannot be resolved even though it's inside the HTML comment. Error is printed and build fails.

Your environment

not relevant

Reproducible demo

https://stackblitz.com/edit/github-qhwl7g?file=docs/intro.md

@KyrietS KyrietS added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Oct 7, 2021
@slorber
Copy link
Collaborator

slorber commented Oct 8, 2021

Thanks

Yes, it seems our remark broken link checking logic does not account for HTML comments.

Problem in packages/docusaurus-utils/src/markdownLinks.ts

@slorber slorber added difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. help wanted Asking for outside help and/or contributions to this particular issue or PR. and removed status: needs triage This issue has not been triaged by maintainers labels Oct 8, 2021
@MattiaPrimavera
Copy link

Hello everybody!

I'm new to the project.
I think indeed that stripping out html comments before analysing md links should fix this.

May I contribute by submitting a PR ?

@slorber
Copy link
Collaborator

slorber commented May 23, 2024

Duplicate of #9048

@slorber slorber marked this as a duplicate of #9048 May 23, 2024
@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
@slorber slorber added closed: duplicate This issue or pull request already exists in another issue or pull request and removed help wanted Asking for outside help and/or contributions to this particular issue or PR. difficulty: intermediate Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan. domain: markdown Related to Markdown parsing or syntax labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: duplicate This issue or pull request already exists in another issue or pull request
Projects
None yet
4 participants