Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix setting the level offset when parsing multiple docs

  • Loading branch information...
commit 8e5b0d14c9021981dbad364c6860c2ab18a40666 1 parent cd77aea
Vicent Marti authored March 30, 2012

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  html/html.c
4  html/html.c
@@ -491,7 +491,9 @@ toc_header(struct buf *ob, const struct buf *text, int level, void *opaque)
491 491
 {
492 492
 	struct html_renderopt *options = opaque;
493 493
 
494  
-	if (options->toc_data.header_count == 0) {
  494
+	/* set the level offset if this is the first header
  495
+	 * we're parsing for the document */
  496
+	if (options->toc_data.current_level == 0) {
495 497
 		options->toc_data.level_offset = level - 1;
496 498
 	}
497 499
 	level -= options->toc_data.level_offset;

0 notes on commit 8e5b0d1

Please sign in to comment.
Something went wrong with that request. Please try again.