quantizor / markdown-to-jsx

🏭 The most lightweight, customizable React markdown component.
https://markdown-to-jsx.quantizor.dev/
MIT License
1.97k stars 169 forks source link

Wrong rendering of link labels containing `[square brackets]` #514

Closed ViktorSviridenko closed 5 months ago

ViktorSviridenko commented 1 year ago

Description

In our project, markdown-to-jsx renders most of the user content, so it's one of the essential libraries.

We faced a problem when we were trying to mark up a page using "footnotes" (like in articles on Wikipedia).

Steps to reproduce

  1. Open the official playground;
  2. Copy and paste the following code snippet.
You can find it on [Google<sup>[1]</sup>](https://google.com).

You can find it on [Google [1]](https://google.com).

1. Google is the world's largest search engine.

Demonstration and comparison with VS Code

image

Additional notes

The error didn't occur in markdown-to-jsx@7.1.9.