Hello,
I found an issue that occurs when you use a VCL-style which applies different font and background colors to the TAdvRichEditor in combination with the TAdvRichEditorHTMLIO-component.
The issue is rather simple and occurs here in "AdvRichEditorIO.pas":
procedure TAdvRichEditorHTMLIO.InsertHTML(HtmlValue: string);
var
tempRE: TAdvRichEditorEx;
begin
if Assigned(RichEditor) then
begin
tempRE := TAdvRichEditorEx.Create(Self);
tempRE.Width := 0;
tempRE.Parent := Application.MainForm;
tempRE.ParseHTML(HTMLValue);
tempRE.SelectAll;
tempRE.CopyToClipboard;
RichEditor.PasteFromClipboard;
tempRE.Free;
end;
end;
A temporary AdvRichEditor is created and used to parse the HTML. This RichEditor doesn't have the VCL-Style of the actual RichEditor applied, which leads to parsing issues since the default colors now differ between those two.
In my case the issue arises from the fact that I use a dark VCL theme with white font color and dark background color, but when using "InserHTML", the result is a text with white background and black font color in a RichEditor with dark background color.
To fix this issue for me on short notice I simply added the two following lines:
tempRE.UseVCLStyles := True;
tempRE.InitVCLStyle(False);
With the VCL-style now properly applied, the HTML-parsing produces the expected result.
If you need further information I would be happy to provide it. If there is an issue with my temporary solution I would also be thankful to be notified.