iainbrighton / PScribo

PowerShell documentation framework
MIT License
231 stars 35 forks source link

Issues with HTML TOC Links for sections with same name #74

Closed tpcarman closed 6 years ago

tpcarman commented 6 years ago

TOC links of a HTML document only navigate to the first reference of a section name, if the section name is repeated.

The example below shows a two sections name 'Sub Section'. Clicking the TOC link for 'Section 2 > Sub Section' will always navigate to the first reference 'Section 1 > Sub Section'

#requires -Module @{ModuleName="PScribo";ModuleVersion="0.7.22"} $Document = Document 'HTML TOC Test' -Verbose { DocumentOption -EnableSectionNumbering -PageSize A4 TOC -Name 'Table of Contents' PageBreak Section -Style Heading1 'Section 1' { Section -Style Heading2 'Sub Section' { Paragraph 'Sub section 1' } } PageBreak PageBreak PageBreak PageBreak PageBreak Section -Style Heading1 'Section 2' { Section -Style Heading2 'Sub Section' { Paragraph 'Sub section 2' } } } $Document | Export-Document -Path ~\Desktop -Format Html