Styles are not applied to URLs with port numbers - v6.0.0-canary.14

A URL without a port is handled as one element. The whole URL has .tok-url .cm-url and gets styled.

<div class="cm-line">
  <span class="tok-url cm-url">https://google.com</span>
</div>

A URL with a port is split into two elements. The part after the port is not treated as a URL, so styles are not applied.

<div class="cm-line">
  <span class="tok-url cm-url">http://127.0.0.1</span>
  <span class="tok-content">:8080/issues/316195</span>
</div>
<div class="cm-line">
  <span class="tok-url cm-url">https://hoge.fuga</span>
  <span class="tok-content">:8080/fuga</span>
</div>

As a result, only part of the URL is styled when a port is included.

Hi @shimizu_tatsuya san,

Thanks for reporting. It looks like a bug in the markdown parser of CodeMirror. I’ll make a PR if I find a solution.

Sent a PR: Fix autolink not working with urls with a port number by craftzdog · Pull Request #63 · lezer-parser/markdown · GitHub