Add links to a text with URLs

03 November 2004   3 comments   Web development

https://www.peterbe.com/plog/add-hrefs/test.html

Mind that age!

This blog post is 16 years old! Most likely, its content is outdated. Especially if it's technical.

I've now written a little something that is able to convert a piece of text and make URLs into hyperlinks. Here's an example:

Go to www.abc.com
and foo@bar.com

this becomes:

Go to <a href="http://www.abc.com">www.abc.com</a>
and <a href="mailto:foo@bar.com">foo@bar.com</a>

Links in email program screenshot

Most of you have probably seen this in the way emails are displayed within their email program. See this screenshot:

Now, what my little program does is that it attempts to accomplish the same effect. The script is written in Python and will be available for download here soon. First I just want you people to help me find any bugs first.

Please try with your text

Comments

Bob Marley

Hello? people! visit to my site!

peter

I am found in google this good sites:

Visit! :)
I am creat this sites.

Vcode Infosystems

Best Indian Films offers complete portal about Bollywood, regional film industry of India, top Indian Bollywood actors and actresses, awards, hits of 2006 and comprehensive coverage of Bollywood gossip. This site is a best online resource for everything you ever wanted to know about India's Film Industries, especially Bollywood.

Your email will never ever be published

Related posts