lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: backticks inside link title prevent Markdown rendering

Open vadimkantorov opened this issue 1 year ago • 1 comments

- [relative/path/to/hello](relative/path/to/hello) : works
- [`relative/path/to/hello`](relative/path/to/hello) : does not render link

In GitHub both ways work:

  • relative/path/to/hello
  • relative/path/to/hello

image

image

It appears a Markdown parsing issue where the backticks-inside-link variant simply does not get parsed as a link

vadimkantorov avatar Jun 25 '24 15:06 vadimkantorov

Maybe the problem is in how https://github.com/facebook/lexical/blob/d13e5b893a2113d2df08c4d69e32cb8a355a8a23/packages/lexical-markdown/src/MarkdownTransformers.ts#L357-L390 is implemented as a text match. Within the caption, some markdown should be parsed too or at least it should still get parsed as a link (even if some formatting from the caption is discarded).

Maybe the backtick is not matched by this regexp? Some other formatting in the captions might be bold/italic text

Or maybe it is that INLINE_CODE gets imported before the links are parsed? Somehow INLINE_CODE in captions should not prevent links from getting parsed correctly

vadimkantorov avatar Jun 27 '24 13:06 vadimkantorov

Duplicate of #5148

etrepum avatar Sep 23 '24 14:09 etrepum