summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2017-07-19 08:45:29 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2017-07-19 08:45:29 +0000
commitad965bdd6935ec6deac1bad27229b6b36645c0db (patch)
tree51ec9eb2503bbdfc275a6d2126fafde3b4bb6609
parent4c4fc625d090ccea7cb041a2b862ee0b016f60ed (diff)
downloadfpc-ad965bdd6935ec6deac1bad27229b6b36645c0db.tar.gz
--- Merging r36747 into '.':
U packages/chm/src/chmfilewriter.pas --- Recording mergeinfo for merge of r36747 into '.': U . # revisions: 36747 git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_0@36748 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/chm/src/chmfilewriter.pas20
1 files changed, 13 insertions, 7 deletions
diff --git a/packages/chm/src/chmfilewriter.pas b/packages/chm/src/chmfilewriter.pas
index 0df67430b2..29c6e8422c 100644
--- a/packages/chm/src/chmfilewriter.pas
+++ b/packages/chm/src/chmfilewriter.pas
@@ -717,8 +717,8 @@ begin
end;
const
- protocols : array[0..3] of string = ('HTTP:','FTP:','MS-ITS:', 'MAILTO:');
- protocollen : array[0..3] of integer= ( 5 ,4 ,7, 7);
+ protocols : array[0..4] of string = ('HTTP:','HTTPS:','FTP:','MS-ITS:', 'MAILTO:');
+ protocollen : array[0..4] of integer= ( 5 ,6, 4 ,7, 7);
function TChmProject.SanitizeURL(const basepath,instring,localpath,localname:string;var outstring:String):Boolean;
var i,j,len : integer;
@@ -813,7 +813,8 @@ end;
function scantags(prnt:TDomNode; const localname: string; filelist:TStringlist):TDomNode;
// Seach first matching tag in siblings
var chld: TDomNode;
- s : ansistring;
+ s,
+ att : ansistring;
i : Integer;
begin
result:=nil;
@@ -845,19 +846,24 @@ begin
begin
//printattributes(chld,'');
checkattributes(chld,'HREF',localname,filelist);
- s := findattribute(chld,'NAME');
+ att := 'NAME';
+ s := findattribute(chld, att);
+ if s = '' then begin
+ att := 'ID';
+ s := findattribute(chld, att);
+ end;
if s <> '' then
begin
i := fAnchorList.IndexOf(localname+'#'+s);
if i < 0 then begin
fAnchorList.Add(localname+'#'+s);
- Error(ChmNote,'New Anchor with name '+s+' found while scanning '+localname,1);
+ Error(ChmNote,'New Anchor with '+att+' '+s+' found while scanning '+localname,1);
end else if fAnchorList.Objects[i] = nil then
- Error(chmwarning,'Duplicate anchor definitions with name '+s+' found while scanning '+localname,1)
+ Error(chmwarning,'Duplicate anchor definitions with '+att+' '+s+' found while scanning '+localname,1)
else begin
fAnchorList.Objects[i].Free;
fAnchorList.Objects[i] := nil;
- Error(ChmNote,'Anchor with name '+s+' defined while scanning '+localname,1);
+ Error(ChmNote,'Anchor with '+att+' '+s+' defined while scanning '+localname,1);
end;
end;
end;