mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 22:20:25 +02:00
wikiconvert: allow fpdoc root nodes with minus, issue #27362, patch from Andi Friess
git-svn-id: trunk@47555 -
This commit is contained in:
parent
ede88bbed7
commit
a3523cddaa
@ -278,9 +278,29 @@ begin
|
||||
debugln(['TWiki2FPDocConverter.OnWikiToken ToDo: Token=',dbgs(Token.Token),' Range=',dbgs(Token.Range),' Class=',Token.ClassName,' ',W.PosToStr(W.CurrentPos)]);
|
||||
end;
|
||||
|
||||
{ IsValidIdent returns true if the first character of Ident is in:
|
||||
'A' to 'Z', 'a' to 'z' or '_' and the following characters are
|
||||
on of: 'A' to 'Z', 'a' to 'z', '0'..'9' or '_' }
|
||||
function IsValidNodeName(const Ident: string): boolean;
|
||||
var
|
||||
p: PChar;
|
||||
begin
|
||||
p:=PChar(Ident);
|
||||
if not (p^ in ['A'..'Z', 'a'..'z', '_', '-']) then exit(false);
|
||||
inc(p);
|
||||
while true do begin
|
||||
if p^ in ['A'..'Z', 'a'..'z', '0'..'9', '_', '-'] then
|
||||
inc(p)
|
||||
else if (p^=#0) and (p-PChar(Ident)=length(Ident)) then
|
||||
exit(true)
|
||||
else
|
||||
exit(false);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWiki2FPDocConverter.SetRootName(AValue: string);
|
||||
begin
|
||||
if (AValue='') or not IsValidIdent(AValue) then
|
||||
if (AValue='') or not IsValidNodeName(AValue) then
|
||||
raise Exception.Create('invalid root name "'+AValue+'"');
|
||||
if FRootName=AValue then Exit;
|
||||
FRootName:=AValue;
|
||||
|
Loading…
Reference in New Issue
Block a user