iainbrighton / PScribo

PowerShell documentation framework
MIT License
231 stars 35 forks source link

Links in TOC for HTML output are broken #48

Closed it-praktyk closed 7 years ago

it-praktyk commented 7 years ago

HTML document what contains a table of content (TOC) has broken links to subsections in it.

</style></head><body><page>
<div class="Normal" style="padding-top: 6em; padding-left: 6em; padding-bottom: 6em; padding-right: 6em;">
<h1 class="TOC">Table of Contents</h1><table>
<tr><td><a href="#1.    RESULTSSUMMARY" style="text-decoration: none;">1.   Results summary</a></td></tr>
<tr><td><a href="#2.    DETAILSFORPASSEDTESTS" style="text-decoration: none;">2.     Details for passed tests</a></td></tr>
<tr><td><a href="#3.    DETAILSFORFAILEDTESTS" style="text-decoration: none;">3.     Details for failed tests</a></td></tr>
<tr><td><a href="#4.    DETAILSFORSKIPPEDTESTS" style="text-decoration: none;">4.    Details for skipped tests</a></td></tr>
<tr><td><a href="#5.    DETAILSFORPENDINGTESTS" style="text-decoration: none;">5.    Details for pending tests</a></td></tr>
<tr><td><a href="#6.    DETAILSFORINCONCLUSIVETESTS" style="text-decoration: none;">6.   Details for inconclusive tests</a></td></tr>
</table>
<a name="1. RESULTSSUMMARY"><h1 class="Heading1">1. Results summary</h1></a><div><table class="tabledefault" style="width:90%;"><thead><tr><th>Total Tests</th><th>Passed Tests</th><th>Failed Tests</th><th>Skipped Tests</th><th>Pending Tests</th><th>Inconclusive Tests</th></tr></thead><tbody>

The issue is probably related to the tab chars used between numbers of sections and sections titles.

Probably helpful link how it can be sorted: How to get a tab character?

it-praktyk commented 7 years ago

Tabs are introduced in the code of Format-Pester.

iainbrighton commented 7 years ago

@it-praktyk Have you considered using the GlobalOption -EnableSectionNumbering option/setting to automatically add section numbers? This will build the TOC and links correctly. I've uploaded an example Gist to try and demonstrate this..

it-praktyk commented 7 years ago

Thx, I'll in the version 1.5.1. The version 1.5.0 will be released tonight (?).