Why Tag didn't close?

General TRichView support forum. Please post your questions here
Post Reply
x_ginger
Posts: 12
Joined: Fri May 07, 2010 9:22 am

Why Tag didn't close?

Post by x_ginger »

I pasted into TRichViewEdit text "Images and hyperlinks" that contained a hyperlink "http://www.richedit.com/forums/viewtopic.php?t=3654". It was copied from Micrisoft Word. Then I started to input some letters, but format wasn't changed! I thought the hyperlink shall close when pasting ended?
Or after saving in database when I write down letters after the hyperlink, the same trouble - text is formatted as hyperlink, and tag is included...

Is it right policy?
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There are procedures for URL detection and hyperlink termination on typing. You need to call then when the user pressed Enter, Tab, space and comma characters.
If you use RichViewActions, use TrvActionInsertHyperlink's DetectURL and TerminateHyperlink methods. Example can be found in the ActionTest demo.
If you do not use RichViewActions, use the unit URLScan.pas from the demo Assorted/Hypertext/URLs.
This unit contains the functions DetectURL and TerminateHyperlink. Example can be found in this demo.
Post Reply