diff --git a/markdown_it/rules_inline/linkify.py b/markdown_it/rules_inline/linkify.py index a8a18153..88224e78 100644 --- a/markdown_it/rules_inline/linkify.py +++ b/markdown_it/rules_inline/linkify.py @@ -27,7 +27,7 @@ def linkify(state: StateInline, silent: bool) -> bool: ): return False - if not (match := SCHEME_RE.match(state.pending)): + if not (match := SCHEME_RE.search(state.pending)): return False proto = match.group(1) diff --git a/tests/test_port/fixtures/linkify.md b/tests/test_port/fixtures/linkify.md index f51bb6b9..02a23b17 100644 --- a/tests/test_port/fixtures/linkify.md +++ b/tests/test_port/fixtures/linkify.md @@ -211,3 +211,38 @@ google\.com .

google.com

. + +Issue [#300](https://github.com/executablebooks/markdown-it-py/issues/300) emphasis inside raw links (underscore) at beginning of line +. +http://example.org/foo._bar_-_baz This works +. +

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

+. + +Issue [#300](https://github.com/executablebooks/markdown-it-py/issues/300) emphasis inside raw links (underscore) at end of line +. +This doesnt http://example.org/foo._bar_-_baz +. +

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

+. + +Issue [#300](https://github.com/executablebooks/markdown-it-py/issues/300) emphasis inside raw links (underscore) mix1 +. +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 +. +

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

+. + +Issue [#300](https://github.com/executablebooks/markdown-it-py/issues/300) emphasis inside raw links (underscore) mix2 +. +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 +. +

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

+. + +emphasis inside raw links (asterisk) at end of line +. +This doesnt http://example.org/foo.*bar*-*baz +. +

This doesnt http://example.org/foo.*bar*-*baz

+. \ No newline at end of file