whtmlhlp.pas 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1999-2000 by Berczi Gabor
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit WHTMLHlp;
  12. interface
  13. uses Objects,WHTML,WAnsi,WHelp;
  14. const
  15. extHTML = '.htm';
  16. extHTMLIndex = '.htx';
  17. ListIndent = 2;
  18. DefIndent = 4;
  19. MaxTopicLinks = 4000; { maximum number of links on a single HTML page }
  20. type
  21. THTMLSection = (hsNone,hsHeading1,hsHeading2,hsHeading3,hsHeading4,hsHeading5,hsHeading6);
  22. PTopicLinkCollection = ^TTopicLinkCollection;
  23. TTopicLinkCollection = object(TStringCollection)
  24. procedure Insert(Item: Pointer); virtual;
  25. function At(Index: sw_Integer): PString;
  26. function AddItem(Item: string): integer;
  27. end;
  28. TParagraphAlign = (paLeft,paCenter,paRight);
  29. PTableElement = ^TTableElement;
  30. TTableElement = object(Tobject)
  31. TextBegin,TextEnd : sw_word;
  32. Alignment : TParagraphAlign;
  33. NextEl : PTableElement;
  34. constructor init(AAlignment : TParagraphAlign);
  35. end;
  36. PTableLine = ^TTableLine;
  37. TTableLine = object(Tobject)
  38. NumElements : sw_word;
  39. Nextline : PTableLine;
  40. FirstEl,LastEl : PTableElement;
  41. constructor Init;
  42. procedure AddElement(PTE : PTableElement);
  43. destructor Done; virtual;
  44. end;
  45. PHTMLTopicRenderer = ^THTMLTopicRenderer;
  46. PTable = ^TTable;
  47. TTable = object(Tobject)
  48. NumLines,NumCols : sw_word;
  49. GlobalOffset,
  50. GlobalTextBegin : sw_word;
  51. WithBorder : boolean;
  52. FirstLine : PTableLine;
  53. LastLine : PTableLine;
  54. PreviousTable : PTable;
  55. Renderer : PHTMLTopicRenderer;
  56. constructor Init(Previous : PTable);
  57. procedure AddLine(PL : PTableLine);
  58. procedure AddElement(PTE : PTableElement);
  59. procedure TextInsert(Pos : sw_word;const S : string);
  60. procedure FormatTable;
  61. destructor Done; virtual;
  62. end;
  63. THTMLTopicRenderer = object(THTMLParser)
  64. function BuildTopic(P: PTopic; AURL: string; HTMLFile: PTextFile; ATopicLinks: PTopicLinkCollection): boolean;
  65. public
  66. function DocAddTextChar(C: char): boolean; virtual;
  67. procedure DocSoftBreak; virtual;
  68. procedure DocTYPE; virtual;
  69. procedure DocHTML(Entered: boolean); virtual;
  70. procedure DocHEAD(Entered: boolean); virtual;
  71. procedure DocMETA; virtual;
  72. procedure DocTITLE(Entered: boolean); virtual;
  73. procedure DocBODY(Entered: boolean); virtual;
  74. procedure DocAnchor(Entered: boolean); virtual;
  75. procedure DocHeading(Level: integer; Entered: boolean); virtual;
  76. procedure DocParagraph(Entered: boolean); virtual;
  77. procedure DocBreak; virtual;
  78. procedure DocImage; virtual;
  79. procedure DocBold(Entered: boolean); virtual;
  80. procedure DocCite(Entered: boolean); virtual;
  81. procedure DocCode(Entered: boolean); virtual;
  82. procedure DocEmphasized(Entered: boolean); virtual;
  83. procedure DocItalic(Entered: boolean); virtual;
  84. procedure DocKbd(Entered: boolean); virtual;
  85. procedure DocPreformatted(Entered: boolean); virtual;
  86. procedure DocSample(Entered: boolean); virtual;
  87. procedure DocStrong(Entered: boolean); virtual;
  88. procedure DocTeleType(Entered: boolean); virtual;
  89. procedure DocVariable(Entered: boolean); virtual;
  90. procedure DocList(Entered: boolean); virtual;
  91. procedure DocOrderedList(Entered: boolean); virtual;
  92. procedure DocListItem; virtual;
  93. procedure DocDefList(Entered: boolean); virtual;
  94. procedure DocDefTerm; virtual;
  95. procedure DocDefExp; virtual;
  96. procedure DocTable(Entered: boolean); virtual;
  97. procedure DocTableRow(Entered: boolean); virtual;
  98. procedure DocTableItem(Entered: boolean); virtual;
  99. procedure DocHorizontalRuler; virtual;
  100. public
  101. function GetSectionColor(Section: THTMLSection; var Color: byte): boolean; virtual;
  102. private
  103. URL: string;
  104. Topic: PTopic;
  105. TopicLinks: PTopicLinkCollection;
  106. TextPtr: sw_word;
  107. InTitle: boolean;
  108. InBody: boolean;
  109. InAnchor: boolean;
  110. InParagraph: boolean;
  111. InPreformatted: boolean;
  112. TopicTitle: string;
  113. Indent: integer;
  114. AnyCharsInLine: boolean;
  115. CurHeadLevel: integer;
  116. PAlign: TParagraphAlign;
  117. LinkIndexes: array[0..MaxTopicLinks] of sw_integer;
  118. LinkPtr: sw_integer;
  119. LastTextChar: char;
  120. { Anchor: TAnchor;}
  121. { Table stuff }
  122. CurrentTable : PTable;
  123. procedure AddText(const S: string);
  124. procedure AddChar(C: char);
  125. procedure AddCharAt(C: char;AtPtr : sw_word);
  126. function AddTextAt(const S: string;AtPtr : sw_word) : sw_word;
  127. end;
  128. PCustomHTMLHelpFile = ^TCustomHTMLHelpFile;
  129. TCustomHTMLHelpFile = object(THelpFile)
  130. constructor Init(AID: word);
  131. destructor Done; virtual;
  132. public
  133. function SearchTopic(HelpCtx: THelpCtx): PTopic; virtual;
  134. function ReadTopic(T: PTopic): boolean; virtual;
  135. private
  136. Renderer: PHTMLTopicRenderer;
  137. DefaultFileName: string;
  138. CurFileName: string;
  139. TopicLinks: PTopicLinkCollection;
  140. end;
  141. PHTMLHelpFile = ^THTMLHelpFile;
  142. THTMLHelpFile = object(TCustomHTMLHelpFile)
  143. constructor Init(AFileName: string; AID: word; ATOCEntry: string);
  144. public
  145. function LoadIndex: boolean; virtual;
  146. private
  147. TOCEntry: string;
  148. end;
  149. PHTMLIndexHelpFile = ^THTMLIndexHelpFile;
  150. THTMLIndexHelpFile = object(TCustomHTMLHelpFile)
  151. constructor Init(AFileName: string; AID: word);
  152. function LoadIndex: boolean; virtual;
  153. private
  154. IndexFileName: string;
  155. end;
  156. PHTMLAnsiView = ^THTMLAnsiView;
  157. PHTMLAnsiConsole = ^THTMLAnsiConsole;
  158. THTMLAnsiConsole = Object(TAnsiViewConsole)
  159. MaxX,MaxY : integer;
  160. procedure GotoXY(X,Y: integer); virtual;
  161. end;
  162. THTMLAnsiView = Object(TAnsiView)
  163. private
  164. HTMLOwner : PHTMLTopicRenderer;
  165. HTMLConsole : PHTMLAnsiConsole;
  166. public
  167. constructor Init(AOwner: PHTMLTopicRenderer);
  168. procedure CopyToHTML;
  169. end;
  170. THTMLGetSectionColorProc = function(Section: THTMLSection; var Color: byte): boolean;
  171. function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
  172. const HTMLGetSectionColor : THTMLGetSectionColorProc = {$ifdef fpc}@{$endif}DefHTMLGetSectionColor;
  173. procedure RegisterHelpType;
  174. implementation
  175. uses Views,WConsts,WUtils,WViews,WHTMLScn;
  176. constructor TTableElement.init(AAlignment : TParagraphAlign);
  177. begin
  178. Alignment:=AAlignment;
  179. NextEl:=nil;
  180. TextBegin:=0;
  181. TextEnd:=0;
  182. end;
  183. { TTableLine methods }
  184. constructor TTableLine.Init;
  185. begin
  186. NumElements:=0;
  187. NextLine:=nil;
  188. Firstel:=nil;
  189. LastEl:=nil;
  190. end;
  191. procedure TTableLine.AddElement(PTE : PTableElement);
  192. begin
  193. if not assigned(FirstEl) then
  194. FirstEl:=PTE;
  195. if assigned(LastEl) then
  196. LastEl^.NextEl:=PTE;
  197. LastEl:=PTE;
  198. Inc(NumElements);
  199. end;
  200. destructor TTableLine.Done;
  201. begin
  202. LastEl:=FirstEl;
  203. while assigned(LastEl) do
  204. begin
  205. LastEl:=FirstEl^.NextEl;
  206. Dispose(FirstEl,Done);
  207. FirstEl:=LastEl;
  208. end;
  209. inherited Done;
  210. end;
  211. { TTable methods }
  212. constructor TTable.Init(Previous : PTable);
  213. begin
  214. PreviousTable:=Previous;
  215. NumLines:=0;
  216. NumCols:=0;
  217. GlobalOffset:=0;
  218. GlobalTextBegin:=0;
  219. FirstLine:=nil;
  220. LastLine:=nil;
  221. WithBorder:=false;
  222. end;
  223. procedure TTable.AddLine(PL : PTableLine);
  224. begin
  225. If not assigned(FirstLine) then
  226. FirstLine:=PL;
  227. if Assigned(LastLine) then
  228. LastLine^.NextLine:=PL;
  229. LastLine:=PL;
  230. Inc(NumLines);
  231. end;
  232. procedure TTable.AddElement(PTE : PTableElement);
  233. begin
  234. if assigned(LastLine) then
  235. begin
  236. LastLine^.AddElement(PTE);
  237. If LastLine^.NumElements>NumCols then
  238. NumCols:=LastLine^.NumElements;
  239. end;
  240. end;
  241. procedure TTable.TextInsert(Pos : sw_word;const S : string);
  242. var
  243. i : sw_word;
  244. begin
  245. i:=Renderer^.AddTextAt(S[i],Pos+GlobalOffset);
  246. GlobalOffset:=GlobalOffset+i;
  247. end;
  248. procedure TTable.FormatTable;
  249. const
  250. MaxCols = 200;
  251. type
  252. TLengthArray = Array [ 1 .. MaxCols] of sw_word;
  253. PLengthArray = ^TLengthArray;
  254. var
  255. ColLengthArray : PLengthArray;
  256. CurLine : PTableLine;
  257. CurEl : PTableElement;
  258. Align : TParagraphAlign;
  259. TextBegin,TextEnd : sw_word;
  260. i,j,Length : sw_word;
  261. begin
  262. GetMem(ColLengthArray,Sizeof(sw_word)*NumCols);
  263. FillChar(ColLengthArray^,Sizeof(sw_word)*NumCols,#0);
  264. { Compute the largest cell }
  265. CurLine:=FirstLine;
  266. For i:=1 to NumLines do
  267. begin
  268. CurEl:=CurLine^.FirstEl;
  269. For j:=1 to NumCols do
  270. begin
  271. if not assigned(CurEl) then
  272. break;
  273. Length:=CurEl^.TextEnd-CurEl^.TextBegin;
  274. if Length>ColLengthArray^[j] then
  275. ColLengthArray^[j]:=Length;
  276. CurEl:=CurEl^.NextEl;
  277. end;
  278. CurLine:=CurLine^.NextLine;
  279. end;
  280. { Adjust to largest cell }
  281. CurLine:=FirstLine;
  282. TextBegin:=GlobalTextBegin;
  283. If (NumLines>0) and WithBorder then
  284. Begin
  285. TextInsert(TextBegin,#218);
  286. For j:=1 to NumCols do
  287. begin
  288. TextInsert(TextBegin,CharStr(#196,ColLengthArray^[j]));
  289. if j<NumCols then
  290. TextInsert(TextBegin,#194);
  291. end;
  292. TextInsert(TextBegin,#191);
  293. TextInsert(TextBegin,hscLineBreak);
  294. End;
  295. For i:=1 to NumLines do
  296. begin
  297. CurEl:=CurLine^.FirstEl;
  298. For j:=1 to NumCols do
  299. begin
  300. if not assigned(CurEl) then
  301. begin
  302. Length:=0;
  303. Align:=paLeft;
  304. end
  305. else
  306. begin
  307. TextBegin:=CurEl^.TextBegin;
  308. TextEnd:=CurEl^.TextEnd;
  309. While (TextEnd>TextBegin) and
  310. (Renderer^.Topic^.Text^[TextEnd+GlobalOffset]=ord(hscLineBreak)) do
  311. dec(TextEnd);
  312. Length:=TextEnd-TextBegin;
  313. Align:=CurEl^.Alignment;
  314. end;
  315. if WithBorder then
  316. TextInsert(TextBegin,#179);
  317. if Length<ColLengthArray^[j] then
  318. begin
  319. case Align of
  320. paLeft:
  321. TextInsert(TextEnd,CharStr(' ',ColLengthArray^[j]-Length));
  322. paRight:
  323. TextInsert(TextBegin,CharStr(' ',ColLengthArray^[j]-Length));
  324. paCenter:
  325. begin
  326. TextInsert(TextBegin,CharStr(' ',(ColLengthArray^[j]-Length) div 2));
  327. TextInsert(TextEnd,CharStr(' ',(ColLengthArray^[j]-Length)- ((ColLengthArray^[j]-Length) div 2)));
  328. end;
  329. end;
  330. end;
  331. if Assigned(CurEl) then
  332. CurEl:=CurEl^.NextEl;
  333. end;
  334. if WithBorder then
  335. TextInsert(TextEnd,#179);
  336. CurLine:=CurLine^.NextLine;
  337. end;
  338. If (NumLines>0) and WithBorder then
  339. Begin
  340. TextInsert(TextEnd,hscLineBreak);
  341. TextInsert(TextEnd,#192);
  342. For j:=1 to NumCols do
  343. begin
  344. TextInsert(TextEnd,CharStr(#196,ColLengthArray^[j]));
  345. if j<NumCols then
  346. TextInsert(TextEnd,#193);
  347. end;
  348. TextInsert(TextEnd,#217);
  349. TextInsert(TextEnd,hscLineBreak);
  350. End;
  351. end;
  352. destructor TTable.Done;
  353. begin
  354. LastLine:=FirstLine;
  355. while assigned(LastLine) do
  356. begin
  357. LastLine:=FirstLine^.NextLine;
  358. Dispose(FirstLine,Done);
  359. FirstLine:=LastLine;
  360. end;
  361. if Assigned(PreviousTable) then
  362. Inc(PreviousTable^.GlobalOffset,GlobalOffset);
  363. inherited Done;
  364. end;
  365. { THTMLAnsiConsole methods }
  366. procedure THTMLAnsiConsole.GotoXY(X,Y : integer);
  367. begin
  368. if X>MaxX then MaxX:=X-1;
  369. if Y>MaxY then MaxY:=Y-1;
  370. inherited GotoXY(X,Y);
  371. end;
  372. { THTMLAnsiView methods }
  373. constructor THTMLAnsiView.Init(AOwner : PHTMLTopicRenderer);
  374. var
  375. R : TRect;
  376. begin
  377. if not assigned(AOwner) then
  378. fail;
  379. R.Assign(0,0,80,25);
  380. inherited init(R,nil,nil);
  381. HTMLOwner:=AOwner;
  382. HTMLConsole:=New(PHTMLAnsiConsole,Init(@Self));
  383. Dispose(Console,Done);
  384. Console:=HTMLConsole;
  385. HTMLConsole^.Size.X:=80;
  386. HTMLConsole^.Size.Y:=25;
  387. HTMLConsole^.ClrScr;
  388. HTMLConsole^.MaxX:=-1;
  389. HTMLConsole^.MaxY:=-1;
  390. HTMLConsole^.BoundChecks:=0;
  391. end;
  392. procedure THTMLAnsiView.CopyToHTML;
  393. var
  394. Attr,NewAttr : byte;
  395. c : char;
  396. X,Y,Pos : longint;
  397. begin
  398. Attr:=(Buffer^[1] shr 8);
  399. HTMLOwner^.AddChar(hscLineBreak);
  400. HTMLOwner^.AddText(hscTextAttr+chr(Attr));
  401. for Y:=0 to HTMLConsole^.MaxY-1 do
  402. begin
  403. for X:=0 to HTMLConsole^.MaxX-1 do
  404. begin
  405. Pos:=(Delta.Y*MaxViewWidth)+X+Y*MaxViewWidth;
  406. NewAttr:=(Buffer^[Pos] shr 8);
  407. if NewAttr <> Attr then
  408. begin
  409. Attr:=NewAttr;
  410. HTMLOwner^.AddText(hscTextAttr+chr(Attr));
  411. end;
  412. c:= chr(Buffer^[Pos] and $ff);
  413. if ord(c)>16 then
  414. HTMLOwner^.AddChar(c)
  415. else
  416. begin
  417. HTMLOwner^.AddChar(hscDirect);
  418. HTMLOwner^.AddChar(c);
  419. end;
  420. end;
  421. { Write start of next line in normal color, for correct alignment }
  422. HTMLOwner^.AddChar(hscNormText);
  423. { Force to set attr again at start of next line }
  424. Attr:=0;
  425. HTMLOwner^.AddChar(hscLineBreak);
  426. end;
  427. end;
  428. function DefHTMLGetSectionColor(Section: THTMLSection; var Color: byte): boolean;
  429. begin
  430. Color:=0;
  431. DefHTMLGetSectionColor:=false;
  432. end;
  433. function EncodeHTMLCtx(FileID: integer; LinkNo: word): longint;
  434. var Ctx: longint;
  435. begin
  436. Ctx:=(longint(FileID) shl 16)+LinkNo;
  437. EncodeHTMLCtx:=Ctx;
  438. end;
  439. procedure DecodeHTMLCtx(Ctx: longint; var FileID: word; var LinkNo: word);
  440. begin
  441. if (Ctx shr 16)=0 then
  442. begin
  443. FileID:=$ffff; LinkNo:=0;
  444. end
  445. else
  446. begin
  447. FileID:=Ctx shr 16; LinkNo:=Ctx and $ffff;
  448. end;
  449. end;
  450. function CharStr(C: char; Count: byte): string;
  451. var S: string;
  452. begin
  453. S[0]:=chr(Count);
  454. if Count>0 then FillChar(S[1],Count,C);
  455. CharStr:=S;
  456. end;
  457. procedure TTopicLinkCollection.Insert(Item: Pointer);
  458. begin
  459. AtInsert(Count,Item);
  460. end;
  461. function TTopicLinkCollection.At(Index: sw_Integer): PString;
  462. begin
  463. At:=inherited At(Index);
  464. end;
  465. function TTopicLinkCollection.AddItem(Item: string): integer;
  466. var Idx: sw_integer;
  467. begin
  468. if Item='' then Idx:=-1 else
  469. if Search(@Item,Idx)=false then
  470. begin
  471. AtInsert(Count,NewStr(Item));
  472. Idx:=Count-1;
  473. end;
  474. AddItem:=Idx;
  475. end;
  476. function THTMLTopicRenderer.DocAddTextChar(C: char): boolean;
  477. var Added: boolean;
  478. begin
  479. Added:=false;
  480. if InTitle then
  481. begin
  482. TopicTitle:=TopicTitle+C;
  483. Added:=true;
  484. end
  485. else
  486. if InBody then
  487. begin
  488. if (InPreFormatted) or (C<>#32) or (LastTextChar<>C) then
  489. if (C<>#32) or (AnyCharsInLine=true) or (InPreFormatted=true) then
  490. begin
  491. AddChar(C);
  492. LastTextChar:=C;
  493. Added:=true;
  494. end;
  495. end;
  496. DocAddTextChar:=Added;
  497. end;
  498. procedure THTMLTopicRenderer.DocSoftBreak;
  499. begin
  500. if InPreformatted then DocBreak else
  501. if AnyCharsInLine then
  502. begin
  503. AddChar(' ');
  504. LastTextChar:=' ';
  505. end;
  506. end;
  507. procedure THTMLTopicRenderer.DocTYPE;
  508. begin
  509. end;
  510. procedure THTMLTopicRenderer.DocHTML(Entered: boolean);
  511. begin
  512. end;
  513. procedure THTMLTopicRenderer.DocHEAD(Entered: boolean);
  514. begin
  515. end;
  516. procedure THTMLTopicRenderer.DocMETA;
  517. begin
  518. end;
  519. procedure THTMLTopicRenderer.DocTITLE(Entered: boolean);
  520. begin
  521. if Entered then
  522. begin
  523. TopicTitle:='';
  524. end
  525. else
  526. begin
  527. { render topic title here }
  528. if TopicTitle<>'' then
  529. begin
  530. AddText(' '+TopicTitle+' Ü'); DocBreak;
  531. AddText(' '+CharStr('ß',length(TopicTitle)+3)); DocBreak;
  532. end;
  533. end;
  534. InTitle:=Entered;
  535. end;
  536. procedure THTMLTopicRenderer.DocBODY(Entered: boolean);
  537. begin
  538. InBody:=Entered;
  539. end;
  540. procedure THTMLTopicRenderer.DocAnchor(Entered: boolean);
  541. var HRef,Name: string;
  542. begin
  543. if Entered and InAnchor then DocAnchor(false);
  544. if Entered then
  545. begin
  546. if DocGetTagParam('HREF',HRef)=false then HRef:='';
  547. if DocGetTagParam('NAME',Name)=false then Name:='';
  548. if Name<>'' then
  549. begin
  550. Topic^.NamedMarks^.InsertStr(Name);
  551. AddChar(hscNamedMark);
  552. end;
  553. if (HRef<>'') then
  554. begin
  555. InAnchor:=true;
  556. AddChar(hscLink);
  557. if LinkPtr<MaxTopicLinks then
  558. begin
  559. HRef:=CompleteURL(URL,HRef);
  560. LinkIndexes[LinkPtr]:=TopicLinks^.AddItem(HRef);
  561. Inc(LinkPtr);
  562. end;
  563. end;
  564. end
  565. else
  566. begin
  567. if InAnchor=true then AddChar(hscLink);
  568. InAnchor:=false;
  569. end;
  570. end;
  571. procedure DecodeAlign(Align: string; var PAlign: TParagraphAlign);
  572. begin
  573. Align:=UpcaseStr(Align);
  574. if Align='LEFT' then PAlign:=paLeft else
  575. if Align='CENTER' then PAlign:=paCenter else
  576. if Align='RIGHT' then PAlign:=paRight;
  577. end;
  578. procedure THTMLTopicRenderer.DocHeading(Level: integer; Entered: boolean);
  579. var Align: string;
  580. C: byte;
  581. SC: THTMLSection;
  582. begin
  583. if Entered then
  584. begin
  585. DocBreak;
  586. CurHeadLevel:=Level;
  587. PAlign:=paLeft;
  588. if DocGetTagParam('ALIGN',Align) then
  589. DecodeAlign(Align,PAlign);
  590. SC:=hsNone;
  591. case Level of
  592. 1: SC:=hsHeading1;
  593. 2: SC:=hsHeading2;
  594. 3: SC:=hsHeading3;
  595. 4: SC:=hsHeading4;
  596. 5: SC:=hsHeading5;
  597. 6: SC:=hsHeading6;
  598. end;
  599. if GetSectionColor(SC,C) then
  600. AddText(hscTextAttr+chr(C));
  601. end
  602. else
  603. begin
  604. AddChar(hscNormText);
  605. CurHeadLevel:=0;
  606. DocBreak;
  607. end;
  608. end;
  609. procedure THTMLTopicRenderer.DocParagraph(Entered: boolean);
  610. var Align: string;
  611. begin
  612. if Entered and InParagraph then DocParagraph(false);
  613. if Entered then
  614. begin
  615. if AnyCharsInLine then DocBreak;
  616. if DocGetTagParam('ALIGN',Align) then
  617. DecodeAlign(Align,PAlign);
  618. end
  619. else
  620. begin
  621. { if AnyCharsInLine then }DocBreak;
  622. PAlign:=paLeft;
  623. end;
  624. InParagraph:=Entered;
  625. end;
  626. procedure THTMLTopicRenderer.DocBreak;
  627. begin
  628. if (CurHeadLevel=1) or (PAlign=paCenter) then
  629. AddChar(hscCenter);
  630. if (PAlign=paRight) then
  631. AddChar(hscRight);
  632. AddChar(hscLineBreak);
  633. if Indent>0 then
  634. AddText(CharStr(#255,Indent)+hscLineStart);
  635. AnyCharsInLine:=false;
  636. end;
  637. procedure THTMLTopicRenderer.DocImage;
  638. var Src,Alt,SrcLine: string;
  639. f : text;
  640. attr : byte;
  641. PA : PHTMLAnsiView;
  642. StorePreformatted : boolean;
  643. begin
  644. if DocGetTagParam('SRC',src) then
  645. begin
  646. if src<>'' then
  647. begin
  648. src:=CompleteURL(URL,src);
  649. { this should be a image file ending by .gif or .jpg...
  650. Try to see if a file with same name and extension .git
  651. exists PM }
  652. src:=DirAndNameOf(src)+'.ans';
  653. if ExistsFile(src) then
  654. begin
  655. PA:=New(PHTMLAnsiView,init(@self));
  656. PA^.LoadFile(src);
  657. if AnyCharsInLine then DocBreak;
  658. StorePreformatted:=InPreformatted;
  659. InPreformatted:=true;
  660. {AddText('Image from '+src+hscLineBreak); }
  661. AddChar(hscInImage);
  662. PA^.CopyToHTML;
  663. InPreformatted:=StorePreformatted;
  664. AddChar(hscInImage);
  665. AddChar(hscNormText);
  666. if AnyCharsInLine then DocBreak;
  667. Dispose(PA,Done);
  668. Exit;
  669. end;
  670. { also look for a raw text file without colors }
  671. src:=DirAndNameOf(src)+'.txt';
  672. if ExistsFile(src) then
  673. begin
  674. Assign(f,src);
  675. Reset(f);
  676. DocPreformatted(true);
  677. while not eof(f) do
  678. begin
  679. Readln(f,SrcLine);
  680. AddText(SrcLine+hscLineBreak);
  681. end;
  682. Close(f);
  683. DocPreformatted(false);
  684. Exit;
  685. end;
  686. end;
  687. end;
  688. if DocGetTagParam('ALT',Alt)=false then
  689. begin
  690. DocGetTagParam('SRC',Alt);
  691. if Alt<>'' then
  692. Alt:='Can''t display '+Alt
  693. else
  694. Alt:='IMG';
  695. end;
  696. if Alt<>'' then
  697. begin
  698. StorePreformatted:=InPreformatted;
  699. InPreformatted:=true;
  700. AddChar(hscInImage);
  701. AddText('['+Alt+']');
  702. AddChar(hscInImage);
  703. AddChar(hscNormText);
  704. InPreformatted:=StorePreformatted;
  705. end;
  706. end;
  707. procedure THTMLTopicRenderer.DocBold(Entered: boolean);
  708. begin
  709. end;
  710. procedure THTMLTopicRenderer.DocCite(Entered: boolean);
  711. begin
  712. end;
  713. procedure THTMLTopicRenderer.DocCode(Entered: boolean);
  714. begin
  715. if AnyCharsInLine then DocBreak;
  716. AddText(hscCode);
  717. DocBreak;
  718. end;
  719. procedure THTMLTopicRenderer.DocEmphasized(Entered: boolean);
  720. begin
  721. end;
  722. procedure THTMLTopicRenderer.DocItalic(Entered: boolean);
  723. begin
  724. end;
  725. procedure THTMLTopicRenderer.DocKbd(Entered: boolean);
  726. begin
  727. end;
  728. procedure THTMLTopicRenderer.DocPreformatted(Entered: boolean);
  729. begin
  730. if AnyCharsInLine then DocBreak;
  731. AddText(hscCode);
  732. DocBreak;
  733. InPreformatted:=Entered;
  734. end;
  735. procedure THTMLTopicRenderer.DocSample(Entered: boolean);
  736. begin
  737. end;
  738. procedure THTMLTopicRenderer.DocStrong(Entered: boolean);
  739. begin
  740. end;
  741. procedure THTMLTopicRenderer.DocTeleType(Entered: boolean);
  742. begin
  743. end;
  744. procedure THTMLTopicRenderer.DocVariable(Entered: boolean);
  745. begin
  746. end;
  747. procedure THTMLTopicRenderer.DocList(Entered: boolean);
  748. begin
  749. if Entered then
  750. begin
  751. Inc(Indent,ListIndent);
  752. DocBreak;
  753. end
  754. else
  755. begin
  756. Dec(Indent,ListIndent);
  757. if AnyCharsInLine then DocBreak;
  758. end;
  759. end;
  760. procedure THTMLTopicRenderer.DocOrderedList(Entered: boolean);
  761. begin
  762. DocList(Entered);
  763. end;
  764. procedure THTMLTopicRenderer.DocListItem;
  765. begin
  766. if AnyCharsInLine then
  767. DocBreak;
  768. AddText('þ'+hscLineStart);
  769. end;
  770. procedure THTMLTopicRenderer.DocDefList(Entered: boolean);
  771. begin
  772. if Entered then
  773. begin
  774. { if LastChar<>hscLineBreak then DocBreak;}
  775. end
  776. else
  777. begin
  778. if AnyCharsInLine then DocBreak;
  779. end;
  780. end;
  781. procedure THTMLTopicRenderer.DocDefTerm;
  782. begin
  783. DocBreak;
  784. end;
  785. procedure THTMLTopicRenderer.DocDefExp;
  786. begin
  787. Inc(Indent,DefIndent);
  788. DocBreak;
  789. Dec(Indent,DefIndent);
  790. end;
  791. procedure THTMLTopicRenderer.DocTable(Entered: boolean);
  792. var
  793. ATable : PTable;
  794. Border : String;
  795. begin
  796. if AnyCharsInLine then
  797. begin
  798. AddChar(hscLineBreak);
  799. AnyCharsInLine:=false;
  800. end;
  801. if Entered then
  802. begin
  803. DocBreak;
  804. New(ATable,Init(CurrentTable));
  805. CurrentTable:=ATable;
  806. CurrentTable^.Renderer:=@Self;
  807. if DocGetTagParam('BORDER',border) then
  808. CurrentTable^.WithBorder:=true;
  809. end
  810. else
  811. begin
  812. CurrentTable^.FormatTable;
  813. ATable:=CurrentTable;
  814. CurrentTable:=ATable^.PreviousTable;
  815. Dispose(ATable,Done);
  816. end;
  817. end;
  818. procedure THTMLTopicRenderer.DocTableRow(Entered: boolean);
  819. var
  820. ATableLine : PTableLine;
  821. begin
  822. if AnyCharsInLine then
  823. begin
  824. AddChar(hscLineBreak);
  825. AnyCharsInLine:=false;
  826. end;
  827. if Entered then
  828. begin
  829. New(ATableLine,Init);
  830. if CurrentTable^.GlobalTextBegin=0 then
  831. CurrentTable^.GlobalTextBegin:=TextPtr;
  832. CurrentTable^.AddLine(ATableLine);
  833. end;
  834. end;
  835. procedure THTMLTopicRenderer.DocTableItem(Entered: boolean);
  836. var
  837. Align : String;
  838. NewEl : PTableElement;
  839. PAlignEl : TParagraphAlign;
  840. begin
  841. if Entered then
  842. begin
  843. if assigned(CurrentTable^.LastLine) and Assigned(CurrentTable^.LastLine^.LastEl) and
  844. (CurrentTable^.LastLine^.LastEl^.TextEnd=sw_word(-1)) then
  845. begin
  846. NewEl:=CurrentTable^.LastLine^.LastEl;
  847. NewEl^.TextEnd:=TextPtr;
  848. end;
  849. PAlignEl:=paLeft;
  850. if DocGetTagParam('ALIGN',Align) then
  851. DecodeAlign(Align,PAlignEl);
  852. New(NewEl,Init(PAlignEl));
  853. CurrentTable^.AddElement(NewEl);
  854. NewEl^.TextBegin:=TextPtr;
  855. NewEl^.TextEnd:=sw_word(-1);
  856. { AddText(' - ');}
  857. end
  858. else
  859. begin
  860. NewEl:=CurrentTable^.LastLine^.LastEl;
  861. NewEl^.TextEnd:=TextPtr;
  862. end;
  863. end;
  864. procedure THTMLTopicRenderer.DocHorizontalRuler;
  865. var OAlign: TParagraphAlign;
  866. begin
  867. OAlign:=PAlign;
  868. if AnyCharsInLine then DocBreak;
  869. PAlign:=paCenter;
  870. DocAddText(' '+CharStr('Ä',60)+' ');
  871. DocBreak;
  872. PAlign:=OAlign;
  873. end;
  874. procedure THTMLTopicRenderer.AddChar(C: char);
  875. begin
  876. if (Topic=nil) or (TextPtr=MaxBytes) then Exit;
  877. Topic^.Text^[TextPtr]:=ord(C);
  878. Inc(TextPtr);
  879. if (C>#15) and ((C<>' ') or (InPreFormatted=true)) then
  880. AnyCharsInLine:=true;
  881. end;
  882. procedure THTMLTopicRenderer.AddCharAt(C: char;AtPtr : sw_word);
  883. begin
  884. if (Topic=nil) or (TextPtr=MaxBytes) then Exit;
  885. if AtPtr>TextPtr then
  886. AtPtr:=TextPtr
  887. else
  888. begin
  889. Move(Topic^.Text^[AtPtr],Topic^.Text^[AtPtr+1],TextPtr-AtPtr);
  890. end;
  891. Topic^.Text^[AtPtr]:=ord(C);
  892. Inc(TextPtr);
  893. end;
  894. procedure THTMLTopicRenderer.AddText(const S: string);
  895. var I: sw_integer;
  896. begin
  897. for I:=1 to length(S) do
  898. AddChar(S[I]);
  899. end;
  900. function THTMLTopicRenderer.AddTextAt(const S: String;AtPtr : sw_word) : sw_word;
  901. var
  902. i,slen,len : sw_word;
  903. begin
  904. if (Topic=nil) or (TextPtr>=MaxBytes) then Exit;
  905. slen:=length(s);
  906. if TextPtr+slen>=MaxBytes then
  907. slen:=MaxBytes-TextPtr;
  908. if AtPtr>TextPtr then
  909. AtPtr:=TextPtr
  910. else
  911. begin
  912. len:=TextPtr-AtPtr;
  913. Move(Topic^.Text^[AtPtr],Topic^.Text^[AtPtr+slen],len);
  914. end;
  915. for i:=1 to slen do
  916. begin
  917. Topic^.Text^[AtPtr]:=ord(S[i]);
  918. Inc(TextPtr);
  919. if (TextPtr=MaxBytes) then Exit;
  920. end;
  921. AddTextAt:=slen;
  922. end;
  923. function THTMLTopicRenderer.GetSectionColor(Section: THTMLSection; var Color: byte): boolean;
  924. begin
  925. GetSectionColor:=HTMLGetSectionColor(Section,Color);
  926. end;
  927. function THTMLTopicRenderer.BuildTopic(P: PTopic; AURL: string; HTMLFile: PTextFile;
  928. ATopicLinks: PTopicLinkCollection): boolean;
  929. var OK: boolean;
  930. TP: pointer;
  931. I: sw_integer;
  932. begin
  933. URL:=AURL;
  934. Topic:=P; TopicLinks:=ATopicLinks;
  935. OK:=Assigned(Topic) and Assigned(HTMLFile) and Assigned(TopicLinks);
  936. if OK then
  937. begin
  938. if (Topic^.TextSize<>0) and Assigned(Topic^.Text) then
  939. begin
  940. FreeMem(Topic^.Text,Topic^.TextSize);
  941. Topic^.TextSize:=0; Topic^.Text:=nil;
  942. end;
  943. Topic^.TextSize:=MaxHelpTopicSize;
  944. GetMem(Topic^.Text,Topic^.TextSize);
  945. TopicTitle:='';
  946. InTitle:=false; InBody:={false}true; InAnchor:=false;
  947. InParagraph:=false; InPreformatted:=false;
  948. Indent:=0; CurHeadLevel:=0;
  949. PAlign:=paLeft;
  950. TextPtr:=0; LinkPtr:=0;
  951. AnyCharsInLine:=false;
  952. LastTextChar:=#0;
  953. OK:=Process(HTMLFile);
  954. if OK then
  955. begin
  956. { --- topic links --- }
  957. if (Topic^.Links<>nil) and (Topic^.LinkSize>0) then
  958. begin
  959. FreeMem(Topic^.Links,Topic^.LinkSize);
  960. Topic^.Links:=nil; Topic^.LinkCount:=0;
  961. end;
  962. Topic^.LinkCount:=LinkPtr{TopicLinks^.Count}; { <- eeeeeek! }
  963. GetMem(Topic^.Links,Topic^.LinkSize);
  964. if Topic^.LinkCount>0 then { FP causes numeric RTE 215 without this }
  965. for I:=0 to Min(Topic^.LinkCount-1,High(LinkIndexes)-1) do
  966. begin
  967. Topic^.Links^[I].FileID:=Topic^.FileID;
  968. Topic^.Links^[I].Context:=EncodeHTMLCtx(Topic^.FileID,LinkIndexes[I]+1);
  969. end;
  970. { --- topic text --- }
  971. GetMem(TP,TextPtr);
  972. Move(Topic^.Text^,TP^,TextPtr);
  973. FreeMem(Topic^.Text,Topic^.TextSize);
  974. Topic^.Text:=TP; Topic^.TextSize:=TextPtr;
  975. end
  976. else
  977. begin
  978. DisposeTopic(Topic);
  979. Topic:=nil;
  980. end;
  981. end;
  982. BuildTopic:=OK;
  983. end;
  984. constructor TCustomHTMLHelpFile.Init(AID: word);
  985. begin
  986. inherited Init(AID);
  987. New(Renderer, Init);
  988. New(TopicLinks, Init(50,500));
  989. end;
  990. function TCustomHTMLHelpFile.SearchTopic(HelpCtx: THelpCtx): PTopic;
  991. function MatchCtx(P: PTopic): boolean; {$ifndef FPC}far;{$endif}
  992. begin
  993. MatchCtx:=P^.HelpCtx=HelpCtx;
  994. end;
  995. var FileID,LinkNo: word;
  996. P: PTopic;
  997. FName: string;
  998. begin
  999. DecodeHTMLCtx(HelpCtx,FileID,LinkNo);
  1000. if (HelpCtx<>0) and (FileID<>ID) then P:=nil else
  1001. if (FileID=ID) and (LinkNo>TopicLinks^.Count) then P:=nil else
  1002. begin
  1003. P:=Topics^.FirstThat(@MatchCtx);
  1004. if P=nil then
  1005. begin
  1006. if LinkNo=0 then
  1007. FName:=DefaultFileName
  1008. else
  1009. FName:=TopicLinks^.At(LinkNo-1)^;
  1010. P:=NewTopic(ID,HelpCtx,0,FName,nil,0);
  1011. Topics^.Insert(P);
  1012. end;
  1013. end;
  1014. SearchTopic:=P;
  1015. end;
  1016. function TCustomHTMLHelpFile.ReadTopic(T: PTopic): boolean;
  1017. var OK: boolean;
  1018. HTMLFile: PMemoryTextFile;
  1019. Name: string;
  1020. Link,Bookmark: string;
  1021. P: sw_integer;
  1022. begin
  1023. Bookmark:='';
  1024. OK:=T<>nil;
  1025. if OK then
  1026. begin
  1027. if T^.HelpCtx=0 then Name:=DefaultFileName else
  1028. begin
  1029. Link:=TopicLinks^.At((T^.HelpCtx and $ffff)-1)^;
  1030. Link:=FormatPath(Link);
  1031. P:=Pos('#',Link);
  1032. if P>0 then
  1033. begin
  1034. Bookmark:=copy(Link,P+1,length(Link));
  1035. Link:=copy(Link,1,P-1);
  1036. end;
  1037. { if CurFileName='' then Name:=Link else
  1038. Name:=CompletePath(CurFileName,Link);}
  1039. Name:=Link;
  1040. end;
  1041. HTMLFile:=New(PDOSTextFile, Init(Name));
  1042. if HTMLFile=nil then
  1043. begin
  1044. New(HTMLFile, Init);
  1045. HTMLFile^.AddLine('<HEAD><TITLE>'+msg_pagenotavailable+'</TITLE></HEAD>');
  1046. HTMLFile^.AddLine(
  1047. '<BODY>'+
  1048. FormatStrStr(msg_cantaccessurl,Name)+'<br><br>'+
  1049. '</BODY>');
  1050. end;
  1051. OK:=Renderer^.BuildTopic(T,Name,HTMLFile,TopicLinks);
  1052. if OK then CurFileName:=Name;
  1053. if HTMLFile<>nil then Dispose(HTMLFile, Done);
  1054. if BookMark='' then
  1055. T^.StartNamedMark:=0
  1056. else
  1057. T^.StartNamedMark:=T^.GetNamedMarkIndex(BookMark)+1;
  1058. end;
  1059. ReadTopic:=OK;
  1060. end;
  1061. destructor TCustomHTMLHelpFile.Done;
  1062. begin
  1063. inherited Done;
  1064. if Renderer<>nil then Dispose(Renderer, Done);
  1065. if TopicLinks<>nil then Dispose(TopicLinks, Done);
  1066. end;
  1067. constructor THTMLHelpFile.Init(AFileName: string; AID: word; ATOCEntry: string);
  1068. begin
  1069. if inherited Init(AID)=false then Fail;
  1070. DefaultFileName:=AFileName; TOCEntry:=ATOCEntry;
  1071. if DefaultFileName='' then
  1072. begin
  1073. Done;
  1074. Fail;
  1075. end;
  1076. end;
  1077. function THTMLHelpFile.LoadIndex: boolean;
  1078. begin
  1079. IndexEntries^.Insert(NewIndexEntry(TOCEntry,ID,0));
  1080. LoadIndex:=true;
  1081. end;
  1082. constructor THTMLIndexHelpFile.Init(AFileName: string; AID: word);
  1083. begin
  1084. inherited Init(AID);
  1085. IndexFileName:=AFileName;
  1086. end;
  1087. function THTMLIndexHelpFile.LoadIndex: boolean;
  1088. function FormatAlias(Alias: string): string;
  1089. begin
  1090. if Assigned(HelpFacility) then
  1091. if length(Alias)>HelpFacility^.IndexTabSize-4 then
  1092. Alias:=Trim(copy(Alias,1,HelpFacility^.IndexTabSize-4-2))+'..';
  1093. FormatAlias:=Alias;
  1094. end;
  1095. (*procedure AddDoc(P: PHTMLLinkScanDocument); {$ifndef FPC}far;{$endif}
  1096. var I: sw_integer;
  1097. TLI: THelpCtx;
  1098. begin
  1099. for I:=1 to P^.GetAliasCount do
  1100. begin
  1101. TLI:=TopicLinks^.AddItem(P^.GetName);
  1102. TLI:=EncodeHTMLCtx(ID,TLI+1);
  1103. IndexEntries^.Insert(NewIndexEntry(FormatAlias(P^.GetAlias(I-1)),ID,TLI));
  1104. end;
  1105. end;*)
  1106. var S: PBufStream;
  1107. LS: PHTMLLinkScanner;
  1108. OK: boolean;
  1109. TLI: THelpCtx;
  1110. I,J: sw_integer;
  1111. begin
  1112. New(S, Init(IndexFileName,stOpenRead,4096));
  1113. OK:=Assigned(S);
  1114. if OK then
  1115. begin
  1116. New(LS, LoadDocuments(S^));
  1117. OK:=Assigned(LS);
  1118. if OK then
  1119. begin
  1120. LS^.SetBaseDir(DirOf(IndexFileName));
  1121. for I:=0 to LS^.GetDocumentCount-1 do
  1122. begin
  1123. TLI:=TopicLinks^.AddItem(LS^.GetDocumentURL(I));
  1124. TLI:=EncodeHTMLCtx(ID,TLI+1);
  1125. for J:=0 to LS^.GetDocumentAliasCount(I)-1 do
  1126. IndexEntries^.Insert(NewIndexEntry(FormatAlias(LS^.GetDocumentAlias(I,J)),ID,TLI));
  1127. end;
  1128. Dispose(LS, Done);
  1129. end;
  1130. Dispose(S, Done);
  1131. end;
  1132. LoadIndex:=OK;
  1133. end;
  1134. function CreateProcHTML(const FileName,Param: string;Index : longint): PHelpFile; {$ifndef FPC}far;{$endif}
  1135. var H: PHelpFile;
  1136. begin
  1137. H:=nil;
  1138. if CompareText(copy(ExtOf(FileName),1,length(extHTML)),extHTML)=0 then
  1139. H:=New(PHTMLHelpFile, Init(FileName,Index,Param));
  1140. CreateProcHTML:=H;
  1141. end;
  1142. function CreateProcHTMLIndex(const FileName,Param: string;Index : longint): PHelpFile; {$ifndef FPC}far;{$endif}
  1143. var H: PHelpFile;
  1144. begin
  1145. H:=nil;
  1146. if CompareText(ExtOf(FileName),extHTMLIndex)=0 then
  1147. H:=New(PHTMLIndexHelpFile, Init(FileName,Index));
  1148. CreateProcHTMLIndex:=H;
  1149. end;
  1150. procedure RegisterHelpType;
  1151. begin
  1152. RegisterHelpFileType({$ifdef FPC}@{$endif}CreateProcHTML);
  1153. RegisterHelpFileType({$ifdef FPC}@{$endif}CreateProcHTMLIndex);
  1154. end;
  1155. END.
  1156. {
  1157. $Log$
  1158. Revision 1.8 2003-03-28 09:52:03 armin
  1159. * changed -1 to sw_word(-1) for textend to compile with 1.1
  1160. Revision 1.7 2003/03/27 14:37:52 pierre
  1161. * try to enhance dispaly of new html docs
  1162. Revision 1.6 2002/09/07 15:40:49 peter
  1163. * old logs removed and tabs fixed
  1164. Revision 1.5 2002/04/23 09:55:22 pierre
  1165. + added lastsynonym and InNameAnchor fields to TCustomHTMLLinkScanner
  1166. these allow to eliminate double index entries pointing to the same
  1167. html file location (which had two different names).
  1168. Revision 1.4 2002/04/11 07:04:23 pierre
  1169. + handle tables
  1170. Revision 1.3 2002/03/20 17:16:11 pierre
  1171. * correct some ansii file conversion problems
  1172. }