Fix anchors for TOC headers

This commit is contained in:
Vicent Marti 2011-05-15 23:59:34 +03:00
parent 7cacf7db36
commit caf7c5e336

View file

@ -278,11 +278,11 @@ rndr_header(struct buf *ob, struct buf *text, int level, void *opaque)
if (ob->size)
bufputc(ob, '\n');
if (options->flags & HTML_TOC) {
bufprintf(ob, "<a name=\"toc_%d\"></a>", options->toc_data.header_count++);
}
if (options->flags & HTML_TOC)
bufprintf(ob, "<h%d id=\"toc_%d\"></a>", level, options->toc_data.header_count++);
else
bufprintf(ob, "<h%d>", level);
bufprintf(ob, "<h%d>", level);
if (text) bufput(ob, text->data, text->size);
bufprintf(ob, "</h%d>\n", level);
}