Can anyone share an example program that detects URLs?

General TRichView support forum. Please post your questions here
Post Reply
gavin310
Posts: 7
Joined: Wed Jan 10, 2007 5:52 am

Can anyone share an example program that detects URLs?

Post by gavin310 »

The example application that comes with RichView (Demos\Delphi\Assorted\Hypertext\URLs) is very basic and I'm having a hard time implementing this feature into my application. I need something that will detect a URL if it is typed in, but if the URL is edited it should refresh the tag with the updated URL. Also if you remove the "http://" or "www." from the URL, it should recognize it's not a valid URL anymore and remove the URL style. If anybody happens to have some sample code that does this, I would really appreciate it. Honestly, I thought that RichView already had this functionality built in when I bought it since other editors have it, but I didn't read well enough :lol: Thanks for any help!

Gavin
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, this is the only demo for URL detection. All complicated logic is in URLScan.pas, copy it to your project.
This file in demos has bug in processing of Unicode text, the fixed version is here: http://www.trichview.com/support/files/urlscan.zip

Yes, this demo does not implement removing link after user removed "http://" or "www.". But I just looked in MS Word 2003 and OE 6 - they do not do it as well.

As for updating tag - yes, this is not implemented yet. I requires additional functions of TRichViewEdit that will be implemented in one of future updates (you can update tag in OnItemAction event, but there will be problems with undo)
Post Reply