Skip to content

Markdown: links without title could display shortened host name #4853

@compulim

Description

@compulim

Is your feature request related to a problem?

Today, for link without title, https://www.example.com/index.html, we display "www.example.com". In JS, new URL(url).host.

We can add special treatments to remove leading "www." if they are on standard port number. See additional context.

Describe the suggestion or request in detail

No response

Describe alternatives you have considered

No response

Additional context

URL Display name Treated
https://www.example.com/index.html example.com Yes
https://www.example.co.jp/index.html example.co.jp Yes
https://www.example.com:443/index.html example.com Yes, default port number
http://www.example.com:80/index.html example.com Yes, default port number
https://www.support.example.com/index.html support.example.com Yes, edge case, difficult to deal with gTLD
https://www.microsoft/index.html microsoft Yes, edge case, microsoft is gTLD, difficult to deal with gTLD
https://www.例子.com/index.html xn--fsqu00a.com Yes, we could consider un-punycode it
https://www.example.com:8443/index.html www.example.com:8443 No, not default port number
https://support.example.com/index.html support.example.com No, not leading with "www.'
https://www2.example.com/index.html www2.example.com No, not leading with "www.'

https://msazure.visualstudio.com/CCI/_workitems/edit/25112776

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions