The TOC have an unordered list item page
ABatenev opened this issue · 1 comments
ABatenev commented
Flayms commented
The current code to detect the page numbers is really simple (and also inefficient), it creates the PDF, then searches for the names of the headers and saves the page numbers it finds:
Markdown2Pdf/Markdown2Pdf/Services/TableOfContentsCreator.cs
Lines 103 to 145 in 0ee3761
This obviously causes issues when the header names exist somewhere else in the PDF.
I don't see an easy way to resolve this though, PDF analysis is quite difficult. It's difficult to know what on a page is a header or to which page a link is pointing.
I am open for ideas or PRs on a better way of handling this.