Skip to content

Markdown link text split across newline breaks filepath-to-urlpath conversion #9636

Closed as not planned

Description

@grschafer

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

If a markdown link spans more than one line, the filepath-to-urlpath conversion mentioned here (https://docusaurus.io/docs/markdown-features/links) does not work.

There's a CodeSandbox repro below, which effectively shows:

<!-- This works, turning the link into "other-page" -->
A [link to another page](other-page.md)

<!-- This doesn't work, the link stays "other-page.md" -->
A [link to
another page](other-page.md)

Splitting link text across lines is valid markdown. It doesn't seem like formatting with prettier breaks link text across multiple lines (i.e. to obey a line width limit), but other tools do, which can lead to this issue unexpectedly breaking the link without any sort of error or warning.

Reproducible demo

https://codesandbox.io/p/devbox/stupefied-mclaren-55crfh

Steps to reproduce

  1. Visit the CodeSandbox link above
  2. Click on the "Demo" link in the top navbar of the browser pane
  3. Both "First link" and "Second link" link to other-page.md, but only the first is converted to point to /docs/other-page

Expected behavior

The markdown loader should convert relative links to files into url paths, regardless of the formatting of the link text.

Actual behavior

Relative links to files are not converted into url paths if the link text spans multiple lines.

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Activity

  1. added
    bug
    status: needs triage
    on Dec 15, 2023
  2. added
    closed: duplicate
    and removed
    status: needs triage
    on Dec 16, 2023
  3. slorber commented on Dec 16, 2023

    @slorber
    Collaborator

    Duplicate of #9523

    Will be handled as part of #9048

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