url rewriting

I discovered Sanitize gem and it's pretty good but one thing I can see is that if someone puts a URL in the body of text without markup, that would become a link that would drive the person who clicks the link off-site which I don't really want.

So if I have say...

@test = "This is a really cool website - http://www.example.com"

I would want it to be changed to...

@test = "This is a really cool website - <a href='http://www.example.com' target='_new' rel='nofollow'>http://www.example.com</a>"

Is there some gem or plugin? Do I have to write some complicated gsub routine?

Craig

Craig White wrote:

I discovered Sanitize gem and it's pretty good but one thing I can see is that if someone puts a URL in the body of text without markup, that would become a link that would drive the person who clicks the link off-site which I don't really want.

So if I have say...

@test = "This is a really cool website - http://www.example.com"

I would want it to be changed to...

@test = "This is a really cool website - <a href='http://www.example.com' target='_new' rel='nofollow'>http://www.example.com</a>"

Probably not a great idea. Don't force links to open in a new window -- it's extremely annoying.

That said, you can do at least some of this with the <base> element.

Is there some gem or plugin? Do I have to write some complicated gsub routine?

Craig

-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

When will you stop appending this silly footer to your e-mail?

Best,