Skip to content

Bug: markdown link transformer wraps the entire line into a link #8129

@levensta

Description

@levensta

Lexical version: 0.40.0

Steps To Reproduce

  1. The string must contain a text node in the form of a markdown-like link. Insert this
    [text](https://x.com) — this is markdown link. Try to write ')'. 
    
  2. Manually write the markdown link on the same line: [text](https://x.com)

Link to code example:

https://playground.lexical.dev/#doc=H4sIAAAAAAAAE51QS2rDMBC9iphNGhCOYpqG6gBdF9xdyEJY01hElsxonMQEQw_RE_YkRU5LmtJVVzPvwbzPnAGt40gVG0bQZ6AYOc-6cd4SBtCbX8AiG-dBKwmvkVrD09pGi6AhZMaDhMSDzwRIYDwxaNjkub1rmLukF4tTUcd2Lj7e3gU3LgmXRGtob-MxCO_CvhAvNAiO4kiOUczms0L8JZENhi5bTT4SDkjJxQB6OW4lWEdY84RD7_01c07mgsVwyf-l0RkyOzJdcyN06fB0bZth9d3wHzbTl2-ijhK8SVyZA1rQy_VarcvVQ_moypWEFHuq892zN8OOYh_sz2tQxb0qFIyfULPppM4BAAA

The current behavior

Аfter the ')' character is triggered, the entire line will wrap in LinkNode. In the text part of the link, square brackets will be cut off at the edges.

current.transform.link.mov

The expected behavior

Only the current link being entered is transformed

Image

Impact of fix

In theory, this may prevent you from writing content for an article on the use of markdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions