GFM protocol autolink starts right after `<`, linking URLs inside non-autolink angle brackets
Marked version: 18.1.1 Markdown flavor: GitHub Flavored Markdown (default)
Description
Same root cause as #4118, but for the http:// / https:// case, which is still reproducible on 18.1.1. No existing issue that I could find for the protocol variant.
Expectation
<https://example.com/foo bar> is not a CommonMark autolink (link destinations can't contain spaces), and a GFM extended autolink "can only come at the beginning of a line, after whitespace, or any of the delimiting characters *, _, ~, and (" — < is not one of them. GitHub renders it as plain text:
<p><https://example.com/foo bar></p>
Result
marked.parse('<https://example.com/foo bar>')
<p><<a href="https://example.com/foo">https://example.com/foo</a> bar></p>
The lexer emits a link token with autolink: true for https://example.com/foo even though it directly follows <, so a chunk of a non-autolink gets linked and the link text misrepresents what was written (the bar> part is dropped from the link but the visible text suggests the whole bracket was a URL).
#4118 covered the www. case (<www.example.com>); the protocol case after < still links on 18.1.1.
It seems to only autolink for GFM not CommonMark which it should since GFM does make it a link