mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 17:59:22 +02:00
IDE, Hint: Fix malformated hints, if text has ampersand. or <,... Issue #0023320 Patch by Bart Broersma
git-svn-id: trunk@39374 -
This commit is contained in:
parent
10030c45db
commit
03b7bd795b
@ -460,24 +460,17 @@ begin
|
|||||||
Result:=copy(Result,1,p-1)+copy(Result,EndPos,length(Result));
|
Result:=copy(Result,1,p-1)+copy(Result,EndPos,length(Result));
|
||||||
end else if Result[p]='&' then begin
|
end else if Result[p]='&' then begin
|
||||||
// special chars: < > &
|
// special chars: < > &
|
||||||
if (Result[p+1]='l') and (Result[p+2]='t') then begin
|
if (p+2<Length(Result)) and (Result[p+1]='l') and (Result[p+2]='t') and (Result[p+3]=';') then begin
|
||||||
EndPos:=p+3;
|
EndPos:=p+4;
|
||||||
if (EndPos<length(Result)) and (Result[EndPos]=';') then
|
Result:=copy(Result,1,p-1)+'<'+copy(Result,EndPos,length(Result));
|
||||||
inc(EndPos);
|
end else
|
||||||
Result:=copy(Result,1,p-1)+'<'+copy(Result,EndPos,length(Result));
|
if (p+2<Length(Result)) and (Result[p+1]='g') and (Result[p+2]='t') and (Result[p+3]=';') then begin
|
||||||
end else
|
EndPos:=p+4;
|
||||||
if (Result[p+1]='g') and (Result[p+2]='t') then begin
|
Result:=copy(Result,1,p-1)+'>'+copy(Result,EndPos,length(Result));
|
||||||
EndPos:=p+3;
|
end else
|
||||||
if (EndPos<length(Result)) and (Result[EndPos]=';') then
|
if (p+3<Length(Result)) and (Result[p+1]='a') and (Result[p+2]='m') and (Result[p+3]='p') and (Result[p+4]=';') then begin
|
||||||
inc(EndPos);
|
EndPos:=p+5;
|
||||||
Result:=copy(Result,1,p-1)+'>'+copy(Result,EndPos,length(Result));
|
Result:=copy(Result,1,p-1)+'&'+copy(Result,EndPos,length(Result));
|
||||||
end else
|
|
||||||
if (Result[p+1]='a') and (Result[p+2]='m') and (Result[p+3]='p') then begin
|
|
||||||
EndPos:=p+4;
|
|
||||||
if (EndPos<length(Result)) and (Result[EndPos]=';') then
|
|
||||||
inc(EndPos);
|
|
||||||
// double '&' to prevent underlining
|
|
||||||
Result:=copy(Result,1,p-1)+'&&'+copy(Result,EndPos,length(Result));
|
|
||||||
end;
|
end;
|
||||||
inc(p);
|
inc(p);
|
||||||
end else
|
end else
|
||||||
@ -518,6 +511,7 @@ begin
|
|||||||
Alignment := taLeftJustify;
|
Alignment := taLeftJustify;
|
||||||
Font.Color := clInfoText;
|
Font.Color := clInfoText;
|
||||||
BorderSpacing.Around := 4;
|
BorderSpacing.Around := 4;
|
||||||
|
ShowAccelChar := False; //don't underline after &
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSimpleHTMLControl.GetURL: string;
|
function TSimpleHTMLControl.GetURL: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user