Skip to content

Link backtick processing seems subtly broken #3777

Description

Marked version:

16.3.0

Describe the bug

When given a string like this...

**Really weird edge case: bold around what looks like it might be a link, but is actually a link-looking thing with a code specifier in. [Like `this](https://github.com)`. It's now impossible to close the bold**. <https://git`hub.com>

...marked seems to correctly parse that the original linked-looking thing is actually a codespan. However, at some other stage, it also decides that the backtick after the link is part of another codespan connecting to the one in the middle of the autolink, which prevents closing the strong element.

To Reproduce
Steps to reproduce the behavior:

  1. marked
  2. CommonMark

Expected behavior

This should be parsed as a strong element with a codespan inside, followed by an autolink. Right now, it's parsed as regular text including a codespan element.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 - annoyingSimilar to L1 - broken but there is a known workaround available for the issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions