micromark / micromark-extension-gfm-autolink-literal

micromark extension to support GFM autolink literals
https://unifiedjs.com
MIT License
7 stars 3 forks source link

Cannot identify links without leading spaces #4

Closed pd4d10 closed 3 years ago

pd4d10 commented 3 years ago

Subject of the issue

Cannot identify links without leading spaces

Your environment

Steps to reproduce

Source: 中http://abc.def

Expected behavior

<p>中<a href="http://abc.def" rel="nofollow">http://abc.def</a></p>

Actual behavior

<p>中http://abc.def</p>
wooorm commented 3 years ago

Hi!

Can you clarify what this has to do with headings, spaces?

pd4d10 commented 3 years ago

Oh sorry, it's a typo. Leading spaces...

If there are spaces before the link literal, it works. For example:

中 http://abc.def
wooorm commented 3 years ago

I created a test case to figure out what GH is doing:

Last whitespace (non-markdown) (FF): noreply@example.com, http://example.com, https://example.com

Last (non-whitespace) control (US): noreply@example.com, http://example.com, https://example.com

First punctuation after controls: !noreply@example.com, !http://example.com, !https://example.com

Last punctuation before digits: /noreply@example.com, /http://example.com, /https://example.com

First digit: 0noreply@example.com, 0http://example.com, 0https://example.com

First punctuation after digits: :noreply@example.com, :http://example.com, :https://example.com

Last punctuation before caps: @noreply@example.com, @http://example.com, @https://example.com

First cap: Anoreply@example.com, Ahttp://example.com, Ahttps://example.com

First punctuation after caps: [noreply@example.com, [http://example.com, [https://example.com

Last punctuation before lowers: `noreply@example.com, `http://example.com, `https://example.com

First lower: anoreply@example.com, ahttp://example.com, ahttps://example.com

First punctuation after lowers: {noreply@example.com, {http://example.com, {https://example.com

Last punctuation: ~noreply@example.com, ~http://example.com, ~https://example.com

Last ASCII control (DEL): noreply@example.com, http://example.com, https://example.com

First non-ASCII whitespace (0x80): …noreply@example.com, …http://example.com, …https://example.com

Last BMP whitespace (0x3000):  noreply@example.com,  http://example.com,  https://example.com

First non-ASCII punctuation: ¡noreply@example.com, ¡http://example.com, ¡https://example.com

Last BMP punctuation: ・noreply@example.com, ・http://example.com, ・https://example.com

Some non-ascii: 中noreply@example.com, 中http://example.com, 中https://example.com

Some more non-ascii: 🤷‍noreply@example.com, 🤷‍http://example.com, 🤷‍https://example.com

Last whitespace (non-markdown) (FF): noreply@example.com, http://example.com, https://example.com

Last (non-whitespace) control (US): noreply@example.com, http://example.com, https://example.com

First punctuation after controls: !noreply@example.com, !http://example.com, !https://example.com

Last punctuation before digits: /noreply@example.com, /http://example.com, /https://example.com

First digit: 0noreply@example.com, 0http://example.com, 0https://example.com

First punctuation after digits: :noreply@example.com, :http://example.com, :https://example.com

Last punctuation before caps: @noreply@example.com, @http://example.com, @https://example.com

First cap: Anoreply@example.com, Ahttp://example.com, Ahttps://example.com

First punctuation after caps: [noreply@example.com, [http://example.com, [https://example.com

Last punctuation before lowers: noreply@example.com,http://example.com, `https://example.com

First lower: anoreply@example.com, ahttp://example.com, ahttps://example.com

First punctuation after lowers: {noreply@example.com, {http://example.com, {https://example.com

Last punctuation: ~noreply@example.com, ~http://example.com, ~https://example.com

Last ASCII control (DEL): noreply@example.com, http://example.com, https://example.com

First non-ASCII whitespace (0x80): …noreply@example.com, …http://example.com, …https://example.com

Last BMP whitespace (0x3000):  noreply@example.com,  http://example.com,  https://example.com

First non-ASCII punctuation: ¡noreply@example.com, ¡http://example.com, ¡https://example.com

Last BMP punctuation: ・noreply@example.com, ・http://example.com, ・https://example.com

Some non-ascii: 中noreply@example.com, 中http://example.com, 中https://example.com

Some more non-ascii: 🤷‍noreply@example.com, 🤷‍http://example.com, 🤷‍https://example.com

^-- Incredibly weird IMO is what’s happening with the slash.

wooorm commented 3 years ago

thanks, released!