Skip to content

A line break inside a markdown link will break url rendering #9523

@chromy96

Description

@chromy96

Have you read the Contributing Guidelines on issues?

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

Two URLs containing a file path to the same document will be rendered differently depending on if the link text contains a line break or not.

Properly rendered url (points to website/docs/example)

[A link example](example.md)

Badly rendered url (points to website/example.md)

[A link
example](example.md)

Docusaurus version: 3.0.0

Reproducible demo

No response

Steps to reproduce

  1. Create a link with a line break in it
  2. Check how the URL is rendered

Expected behavior

Expected a URL to be rendered the same way as without the line break.

Actual behavior

A link points to website/example.md instead of website/docs/example

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: 3.0.0
  • Environment name and version (e.g. Chrome 89, Node.js 18.2): Chrome 119, Node.js 18.2
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Ubuntu 20.04

Self-service

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiondomain: markdownRelated to Markdown parsing or syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions