Forum How do I...?

TOC Suddenly Not Working

caylan
I've spent 100+ hours on a PDF that, in the last 4 hours of work, has lost TOC page numbers. I can't figure out why they all read, "0." The links in the HTML file work fine. The links in the PDF are broken.

In TOC:
<a class="toc" href="#doc-1,2">Void Sale</a><br><a name="toc-1,3"></a>

Body:
<a name="doc-1,2"></a><a href="#toc-1" style="text-decoration: none"><h2 title="Void Sale" class="bookmark2">1.2) Void Sale
</h2></a>

CSS:
a[href].toc::after {
content: leader(" .") target-counter(attr(href), page);
}

Prince Output:
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1: error: Tag article invalid
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:825: error: htmlParseEntityRef: no name
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1152: error: htmlParseEntityRef: no name
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1485: error: htmlParseEntityRef: no name
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1485: error: htmlParseEntityRef: no name
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1494: error: Unexpected end tag : span
prince: /Volumes/copos 2.vmdk/DTM66/MANUAL.HTM:1551: error: htmlParseEntityRef: no name

MANUAL.HTM line 1485 contains:
<p>Test</p><p> Test</p>

Output attached as PNG. What's wrong?
  1. out.pdf (page 3 of 62)-1.png28.0 kB
mikeday
Empty anchor elements in a block context do not currently work as the target of link elements. If you make link to an ID on the heading element or move the anchor element inside another element that has text content then it should work.
caylan
Thank you, Mike. Linking to an ID in the header is a perfect fit. Cheers.