From 94bf3842eab4de3a4a13d28249ba3f46f1a714a4 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Tue, 7 Feb 2023 16:46:34 +0100 Subject: [PATCH] IDE/CodeHelp: Adds missing FPDoc tags to TCodeHelpManager.GetFPDocNodeAsHTML. Patch by Don Siders. Issue #40112. --- ide/codehelp.pas | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ide/codehelp.pas b/ide/codehelp.pas index ed638cf85b..0f72a93a18 100644 --- a/ide/codehelp.pas +++ b/ide/codehelp.pas @@ -2944,16 +2944,38 @@ function TCodeHelpManager.GetFPDocNodeAsHTML(FPDocFile: TLazFPDocFile; end else if (Node.NodeName='p') or (Node.NodeName='b') + or (Node.NodeName='i') or (Node.NodeName='pre') or (Node.NodeName='table') or (Node.NodeName='th') or (Node.NodeName='tr') or (Node.NodeName='td') or (Node.NodeName='ul') + or (Node.NodeName='ol') or (Node.NodeName='li') + or (Node.NodeName='dl') + or (Node.NodeName='dt') + or (Node.NodeName='dd') or (Node.NodeName='hr') then begin Result:=Result+'<'+Node.NodeName+'>'+AddChilds(Node)+''; + end else + // fpdoc file tag as html span.file + if (Node.NodeName='file') then begin + Result:=Result+''+AddChilds(Node)+''; + end else + // fpdoc code tag as html pre tag + if (Node.NodeName='code') then begin + Result:=Result+'
'+AddChilds(Node)+'
'; + end else + // fpdoc url tag as html anchor + if (Node.NodeName='url') and (Node.Attributes<>nil) then begin + Attr:= Node.Attributes.GetNamedItem('href'); + if (Attr=nil) or (Attr.NodeValue='') then exit; + s:=AddChilds(Node); + // append href as comment - it is not clickable or selectable in the help hint + Result:=Result+''+s+' '+ + '['+Attr.NodeValue+']'; end else if (Node.NodeName='var') then begin Result:=Result+''+AddChilds(Node)+''; end else if (Node.NodeName='link') and (Node.Attributes<>nil) then begin