

Ask PG: Add other top-level domains to HN's domain list. - bennyg

It seems like whenever I type a comment or self post that includes a domain like www.somewebaddress.io the HN servers don&#x27;t recognize&#x2F;display this as a link. Is there a list of domain codes that the server recognizes, and is there a way to add new ones in? This will probably be a lot more relevant when the new domains from ICANN start making their appearance too.
======
dangrossman
URLs in self-posts are not turned into links. URLs in comments are. There's no
domain filtering in this code AFAIK.

Your URL in the earlier comment wasn't turned into a link because it wasn't a
link, you just typed a bare domain without the protocol --

[http://www.somewebaddress.io](http://www.somewebaddress.io) not
www.somewebaddress.io

~~~
bennyg
They have to be turned into <a> links somehow. I feel like the server
recognizes links and creates the proper HTML tags when generating the page.

~~~
dangrossman
Yes, the server recognizes links and creates the proper HTML tags. It does so
by looking for properly formed URLs in the text, and does not check domains
against any list. My comment was both an answer and an example -- the
[http://www.somewebaddress.io](http://www.somewebaddress.io) in it was turned
into a link while www.somewebaddress.io was not. Perhaps that's unclear
through whatever app you're reading this on.

~~~
bennyg
Ahh, I was under the impression that just typing www.google.com would come
back correctly vs. having to put the http(s):// in front.

I figured that a .io link was somehow different than a .com as far as link
checking goes. Maybe www. should be added to the regex?

