Skip to content

Unresolved link inside HTML comment #5659

Closed as not planned
Closed as not planned

Description

@KyrietS

🐛 Bug Report

Prerequisites

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

Activity

  1. added
    bug
    status: needs triage
    on Oct 7, 2021
  2. slorber commented on Oct 8, 2021

    @slorber
    Collaborator

    Thanks

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

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

  3. added
    difficulty: intermediate
    and removed
    status: needs triage
    on Oct 8, 2021
  4. MattiaPrimavera commented on Oct 8, 2021

    @MattiaPrimavera

    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 ?

  5. added
    domain: markdown
    on Mar 29, 2022
  6. slorber commented on May 23, 2024

    @slorber
    Collaborator

    Duplicate of #9048

  7. added
    closed: duplicate
    and removed
    difficulty: intermediate
    domain: markdown
    on May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclosed: duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions