Permalink
Browse files

Fix setting the level offset when parsing multiple docs

  • Loading branch information...
1 parent cd77aea commit 8e5b0d14c9021981dbad364c6860c2ab18a40666 @vmg vmg committed Mar 29, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 html/html.c
View
@@ -491,7 +491,9 @@ toc_header(struct buf *ob, const struct buf *text, int level, void *opaque)
{
struct html_renderopt *options = opaque;
- if (options->toc_data.header_count == 0) {
+ /* set the level offset if this is the first header
+ * we're parsing for the document */
+ if (options->toc_data.current_level == 0) {
options->toc_data.level_offset = level - 1;
}
level -= options->toc_data.level_offset;

0 comments on commit 8e5b0d1

Please sign in to comment.