Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localhost autolinks #827

Open
joriszwart opened this issue Nov 25, 2024 · 2 comments
Open

localhost autolinks #827

joriszwart opened this issue Nov 25, 2024 · 2 comments
Labels

Comments

@joriszwart
Copy link

It looks like auto linking doesn't work for localhost (and other single part domains):

http://localhost:5000 # not rendered
http://localhost.dev:5000 # rendered
http://example:5000 # not rendered

This may be intentional, but I have not found anything like this in the autolink extension.

@dmitry-azaraev
Copy link

This looks like method IsValidDomain requires to have at least two segments (i did not know if it is exist other assumptions about in other places).

if (c != 't' && !LinkHelper.IsValidDomain(link, domainOffset))

@snnz
Copy link
Contributor

snnz commented Nov 28, 2024

GFM spec says:

An extended www autolink will be recognized when the text www. is found followed by a valid domain. A valid domain consists of segments of alphanumeric characters, underscores (_) and hyphens (-) separated by periods (.). There must be at least one period ...

and then:

An extended url autolink will be recognised when one of the schemes http://, or https://, followed by a valid domain

One would think that "There must be at least one period" is related to the definition of the valid domain, but it seems to apply to the www autolinks only.

@xoofx xoofx added the question label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants