vmg / rinku

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

How to open web links in a separate window, but not email links? #66

Closed donv closed 7 years ago

donv commented 7 years ago

Hi!

I use Rinku to auto_link my markdown, and it works great! Thanks!

I use Rinku like this

Rinku.auto_link text, :all, 'target="_blank"'

This opens the links in a new window. Excellent! However, it also opens a new window for all email links, and that is very annoying. Is there a way to avoid opening email links in a new window?

donv commented 7 years ago

I have a workaround which is good enough for me:

linked_text = Rinku.auto_link text, :urls, 'target="_blank"'
Rinku.auto_link linked_text, :email_addresses