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

9 points by bennyg ↗ HN
It seems like whenever I type a comment or self post that includes a domain like www.somewebaddress.io the HN servers don't recognize/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.

5 comments

[ 2.8 ms ] story [ 22.0 ms ] thread
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 not www.somewebaddress.io

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.
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 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.
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?

(comment deleted)