mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
* patch from Jeppe
- off by one error that causes keywords that only occur once from not being included in the full text search - support for scanning files referenced in css file url() - fix bug in sitemap wrt "merge" entry git-svn-id: trunk@39378 -
This commit is contained in:
parent
62fa67d9d8
commit
de160955e6
@ -933,6 +933,8 @@ begin
|
||||
Error(ChmWarning,'Found file '+s+' while scanning '+fn+', but couldn''t find it on disk',2);
|
||||
end;
|
||||
except
|
||||
on e:EDomError do
|
||||
Error(ChmError,'Html parsing '+fn+', failed with a DOM error: '+e.Message);
|
||||
on e:exception do
|
||||
Error(ChmError,'Html parsing '+fn+', failed. Please submit a bug.');
|
||||
end;
|
||||
@ -943,6 +945,29 @@ begin
|
||||
Error(chmnote,'Can''t find file '+fn+' to scan it.',5);
|
||||
end;
|
||||
end
|
||||
else if FileExists(fn) and (uppercase(ExtractFileExt(fn))='.CSS') then
|
||||
begin
|
||||
tmplst:=TStringList.Create;
|
||||
try
|
||||
tmplst.LoadFromFile(fn);
|
||||
|
||||
for i:=0 to tmplst.Count-1 do
|
||||
begin
|
||||
s:=tmplst[i];
|
||||
if pos('url(''', tmplst[i])>0 then
|
||||
begin
|
||||
delete(s,1,pos('url(''', tmplst[i])+4);
|
||||
s:=trim(copy(s,1,pos('''',s)-1));
|
||||
|
||||
if not trypath(s) then
|
||||
// if not trypath(localpath+s) then
|
||||
Error(ChmWarning,'Found file '+s+' while scanning '+fn+', but couldn''t find it on disk',2);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
tmplst.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Error(chmnote,'Not scanning file because of unknown extension '+fn,5);
|
||||
end;
|
||||
|
@ -169,8 +169,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TChmSiteMap.FoundTag(ACaseInsensitiveTag, AActualTag: string);
|
||||
procedure NewSiteMapItem;
|
||||
begin
|
||||
FCurrentItems.Add(TChmSiteMapItem.Create(FCurrentItems));
|
||||
end;
|
||||
function ActiveItem: TChmSiteMapItem;
|
||||
begin
|
||||
if FCurrentItems.Count=0 then
|
||||
NewSiteMapItem;
|
||||
|
||||
Result := FCurrentItems.Item[FCurrentItems.Count-1]
|
||||
end;
|
||||
procedure IncreaseULevel;
|
||||
@ -189,10 +196,6 @@ procedure TChmSiteMap.FoundTag(ACaseInsensitiveTag, AActualTag: string);
|
||||
else FCurrentItems := nil;
|
||||
Dec(FLevel);
|
||||
end;
|
||||
procedure NewSiteMapItem;
|
||||
begin
|
||||
FCurrentItems.Add(TChmSiteMapItem.Create(FCurrentItems));
|
||||
end;
|
||||
var
|
||||
TagName,
|
||||
//TagAttribute,
|
||||
|
@ -216,6 +216,10 @@ procedure TIndexedWordList.CBFountText(Text: string);
|
||||
begin
|
||||
if Length(Text) < 1 then
|
||||
Exit;
|
||||
|
||||
if (not FInTitle) and (not FInBody) then
|
||||
Exit;
|
||||
|
||||
EatWords(Text, FInTitle and not FInBody);
|
||||
end;
|
||||
|
||||
@ -278,7 +282,7 @@ begin
|
||||
WordName := Copy(WordStart, 0, (WordPtr-WordStart));
|
||||
try
|
||||
WordIndex := addgetword(wordname,istitle); // Self.Words[WordName, IsTitle];
|
||||
except on e:exception do writeln(wordname); end;
|
||||
except on e:exception do writeln('Error: ', wordname); end;
|
||||
WordIndex.DocumentTopic[FTopicIndex].AddWordIndex(FWordCount);
|
||||
InWord := False;
|
||||
//if IsNumberWord then WriteLn('Following is NUMBER WORD: "', (WordStart[0]),'"'); ;
|
||||
@ -497,7 +501,7 @@ end;
|
||||
|
||||
function TIndexDocument.getindexentries:integer;
|
||||
begin
|
||||
result:=flastentry-1;
|
||||
result:=flastentry;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user