Do you have a question? Post it now! No Registration Necessary. Now with pictures!
June 18, 2005, 2:12 am
rate this thread
I am trying to write a content management section for a web site.
I have managed so far to use htmlarea to give users a basic, but user
friendly interface by which to edit the page content.
The user can add emails by symply typing firstname.lastname@example.org - IE automatically
converts this to a hyperlink. The trouble is sometimes the users use plain
text. I have been using the following line to convert plain text to a
'<a href="mailto:\0?subject=Email%20from%20web%20site">\0</a> ',
This works well - BUT it completely screws up any existing hyperlinks. Is
there a way to convert the plain text email address in to a hyperlink only
if it is NOT part of a hyperlink.
Basically I need some way of checking
* If it's plain text > convert to a hyperlink
* If it's already an email hyperlink leave it alone.
I have tried looking up and testing everything I can think of - but am
finally asking around before I go mad.