facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.68k stars 8.52k forks source link

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

Closed chromy96 closed 1 year ago

chromy96 commented 1 year ago

Have you read the Contributing Guidelines on issues?

Prerequisites

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

Self-service

Josh-Cena commented 1 year ago

This is currently working as intended because we only process links line-by-line. We can investigate making it multiline but I wonder if it would be as trivial as the other Markdown link bugs. We'll soon use an actual Markdown parser for this.

slorber commented 1 year ago

Closing as duplicate of https://github.com/facebook/docusaurus/issues/9048

This bug is only there because we don't use MDX/Remark/micromark to resolve links using filename extensions.