Skip to content

New linkify rule does not linkify URLs entirely when they have a preceding text token #300

@miteshashar

Description

@miteshashar

Describe the bug

context

v2.2.0...v3.0.0#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR21-R23

When I provide this input:

http://example.org/foo._bar_-_baz This works

This doesnt http://example.org/foo._bar_-_baz

While this `does` http://example.org/foo._bar_-_baz, this doesnt http://example.org/foo._bar_-_baz and this **does** http://example.org/foo._bar_-_baz

This applies to _series of URLs too_ http://example.org/foo._bar_-_baz http://example.org/foo._bar_-_baz, these dont http://example.org/foo._bar_-_baz http://example.org/foo._bar_-_baz and these **do** http://example.org/foo._bar_-_baz http://example.org/foo._bar_-_baz

expectation
I expect all URLs to get linkified correctly and entirely.

bug
But instead the ones indicated in the provided input do not get linkified.
image

problem
This is a problem for people using URLs in their content, because they expect consistency in the output.

Reproduce the bug

The provided input content suffices to indicate the use cases where the bug occurs.

List your environment

markdown-it-py==3.0.0
mdit-py-plugins==0.4.0

Python version: 3.11.4
OS: MacOS

Markdown parser config:

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