HTML Input - Auto Format URL's
| From: | Chris | Date: | Wed, 24 Jan 2007 14:10:02 +0000 |
| Subject: | HTML Input - Auto Format URL's | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-247696@lists.php.net to get a copy of this message | ||
Hi,
I'm currently looking into the best way to approach this.
Users will be allowed to enter HTML, but I want to add the ability to
automatically format URL's and e-mail addresses.
The problem here is before formatting URL's we need to ignore URL's that are
already used in HTML tags and that are already formatted as hyperlinks.
First I am thinking if its possible to achieve this with various regular
expression patterns.
Another is to do a first pass of the input and find out what to ignore, then
on a second pass with format the links that were determined to be formatted.
I am welcome to any suggestions about this.
Thanks.