Skip to content

_https://example.com/a_ not parsed correctly #317

Open
@nschloe

Description

@nschloe

Describe the bug

MWE:

from markdown_it import MarkdownIt
from markdown_it.tree import SyntaxTreeNode

md = MarkdownIt("gfm-like")

# okay:
tokens = md.parse("_https://example.com_")
print(SyntaxTreeNode(tokens).pretty())

# bug:
tokens = md.parse("_https://example.com/a_")
print(SyntaxTreeNode(tokens).pretty())

Output:

<root>
  <paragraph>
    <inline>
      <em>
        <link href='https://example.com'>
          <text>
<root>
  <paragraph>
    <inline>
      <text>
      <link href='https://example.com/a_'>
        <text>

Note how the underscore is incorrectly included in the last link.

Reproduce the bug

See above.

List your environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions