mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 07:39:26 +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));
|
||||
end else if Result[p]='&' then begin
|
||||
// special chars: < > &
|
||||
if (Result[p+1]='l') and (Result[p+2]='t') then begin
|
||||
EndPos:=p+3;
|
||||
if (EndPos<length(Result)) and (Result[EndPos]=';') then
|
||||
inc(EndPos);
|
||||
Result:=copy(Result,1,p-1)+'<'+copy(Result,EndPos,length(Result));
|
||||
end else
|
||||
if (Result[p+1]='g') and (Result[p+2]='t') then begin
|
||||
EndPos:=p+3;
|
||||
if (EndPos<length(Result)) and (Result[EndPos]=';') then
|
||||
inc(EndPos);
|
||||
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));
|
||||
if (p+2<Length(Result)) and (Result[p+1]='l') and (Result[p+2]='t') and (Result[p+3]=';') then begin
|
||||
EndPos:=p+4;
|
||||
Result:=copy(Result,1,p-1)+'<'+copy(Result,EndPos,length(Result));
|
||||
end else
|
||||
if (p+2<Length(Result)) and (Result[p+1]='g') and (Result[p+2]='t') and (Result[p+3]=';') then begin
|
||||
EndPos:=p+4;
|
||||
Result:=copy(Result,1,p-1)+'>'+copy(Result,EndPos,length(Result));
|
||||
end else
|
||||
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
|
||||
EndPos:=p+5;
|
||||
Result:=copy(Result,1,p-1)+'&'+copy(Result,EndPos,length(Result));
|
||||
end;
|
||||
inc(p);
|
||||
end else
|
||||
@ -518,6 +511,7 @@ begin
|
||||
Alignment := taLeftJustify;
|
||||
Font.Color := clInfoText;
|
||||
BorderSpacing.Around := 4;
|
||||
ShowAccelChar := False; //don't underline after &
|
||||
end;
|
||||
|
||||
function TSimpleHTMLControl.GetURL: string;
|
||||
|
Loading…
Reference in New Issue
Block a user