vmg / rinku

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

auto_link does not recognise localhost:3000 links #7

Closed wakiki closed 8 years ago

wakiki commented 13 years ago

Hi, in Rails we often use addresses with localhost:3000 in development. Rinku doesn't seem to recognise these as links.

eg. http://localhost:3000/xyz

Can this be included so it turns them into links too?

Thanks

Steve

kgolm commented 13 years ago

This is important to me, too.

Thank you Kilian

trenty27 commented 12 years ago

+1

Thanks, Trenty

james2m commented 12 years ago

+1

ndbroadbent commented 12 years ago

Hi, +1 from me too.

http://localhost:3000/users/1 doesn't autolink, which is frustrating during development.

ndbroadbent commented 12 years ago

Great, it looks like the latest code on the master branch supports autolinking these domains by setting Rinku.short_domains = true after you call require 'rails_rinku'.

Please note, though, that http://localhost:3000/users/1 is autolinked when using the rails_autolink gem, so you'll need to fix it if you still want to claim "mimics 100% the original one".

rdetert commented 10 years ago

Also won't catch "github.com", but it does work for "http://github.com" and "www.github.com"

davidhq commented 9 years ago

Rinku.short_domains doesn't exist anymore... So how is this done nowadays?

kivikakk commented 8 years ago

Rinku.short_domains is now a flag which can be passed to Rinku.auto_link:

>> Rinku.auto_link('http://localhost:3000/a', nil, nil, nil, Rinku::AUTOLINK_SHORT_DOMAINS)
=> "<a href=\"http://localhost:3000/a\">http://localhost:3000/a</a>"

Not catching "github.com" without a preceding http:// or www. is intentional.