vmg / rinku

Autolinking. Ruby. Yes, that's pretty much it.
ISC License
597 stars 67 forks source link

Underscores in subdomains break autolinking #82

Closed kivikakk closed 5 years ago

kivikakk commented 5 years ago

Opened from an internal issue (gh#106307) — cmark-gfm's autolinker will happily autolink subdomains with underscores in them. Live example:

https://abc_def.google.com

Rinku does not, and this disparity can cause confusion at times. Underscores aren't "meant" to be in domain names but subdomains with them do resolve and so are valid by use. Rinku should support this.

Note that this does not extend to underscores in the registrable domain:

https://abc_def.com

This is not valid, and Rinku and cmark-gfm both correctly disallow it. This should be maintained in the face of a fix.