New HTML base path

General TRichView support forum. Please post your questions here
Post Reply
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

New HTML base path

Post by jgkoehn »

Greetings Sergey,
I need the basepath for css and other items but I have some html links that have tw:// instead of https:// so the base path gets added in these instance and I would rather it didn't is there a way I can make it turn off for those specific links?
so <a href="tw://.....">Link</a>
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: New HTML base path

Post by Sergey Tkachenko »

There is an option for not-adding base path to all HTML links. There is OnReadHyperlink event where you can modify target of specific links.
But for your task, the best way is to tell TRichView that 'tw' is a URL prefix.

Code: Select all

uses
  RVFileFuncs, RVStrFuncs;

...

function MyURLCheck(const Word: TRVUnicodeString): Boolean;
begin
  Result := RVBeginsWithW(RVLowerCaseW(Word), 'tw:');
end;

initialization

RVIsCustomURL := MyURLCheck;
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: New HTML base path

Post by jgkoehn »

Excellent thank you sir
Post Reply