From 75531364235598f85d0283853de25782ba81ae56 Mon Sep 17 00:00:00 2001 From: wp Date: Wed, 24 Jun 2015 06:44:18 +0000 Subject: [PATCH] wiki: Fix internal links in created chm files to be functional also with LHelp git-svn-id: trunk@49423 - --- components/wiki/lazwiki/wiki2xhtmlconvert.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/wiki/lazwiki/wiki2xhtmlconvert.pas b/components/wiki/lazwiki/wiki2xhtmlconvert.pas index 063f20a722..dc818532bd 100644 --- a/components/wiki/lazwiki/wiki2xhtmlconvert.pas +++ b/components/wiki/lazwiki/wiki2xhtmlconvert.pas @@ -344,8 +344,17 @@ begin if HeaderTxt<>'' then begin HRef:=WikiHeaderToLink(HeaderTxt); // add anchor - Page.CurDOMNode.SetAttribute('id', HRef); + // modern version:

Text - commented because not understood by IpHTMLPanel: + // Page.CurDOMNode.SetAttribute('id', HRef); + + // old version:

Text

+ Node := doc.CreateElement('a'); + Node.SetAttribute('name', HRef); + Node.AppendChild(Page.CurDOMNode.DetachChild(Page.CurDOMNode.FirstChild)); + Page.CurDOMNode.AppendChild(Node); + // add TOC link + //
  • Text
  • LINode:=doc.CreateElement('li'); LINode.SetAttribute('class', 'toclevel-'+IntToStr(Page.SectionLevel)); Page.CurTOCNode.AppendChild(LINode);