Page 1 of 1

New HTML base path

Posted: Wed Feb 22, 2023 2:06 am
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>

Re: New HTML base path

Posted: Wed Feb 22, 2023 10:27 am
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;

Re: New HTML base path

Posted: Wed Feb 22, 2023 4:17 pm
by jgkoehn
Excellent thank you sir