Skip to content

Bug: Markdown export breaks formatting when the format starts with the link #7817

@piotr-musiol

Description

@piotr-musiol

Lexical version: 0.35.0

Steps To Reproduce

  1. in Playground, create a link and then add some text
Image
  1. Add "bold" to both elements
Image
  1. convert to markdown
Image
  1. convert back
Image

The same thing happens with "italic" style *.

Image

The link doesn't have to be the start of the line, just start of the format

Image

note

The issue looks very similar to one I've reported before; however, even though the steps are similar, the result is different (the right side of ** is just completely missing), so I think it deserves a separate report.

The current behavior

[**link](url) message**

The generated markdown is invalid; as shown in step 4, Lexical also fails to parse it correctly.

The expected behavior

The generated markdown to be parsable. I guess something like that:
**[link](url) message**

sounds the most reasonable

Impact of fix

The provided steps gives you 100% reproducibility. So every user who uses markdown and basic rich utils is impacted.

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