Permalink
Browse files

Do not close TOC div if we never open it

  • Loading branch information...
1 parent aa1f2c0 commit 30fee253240199f46f4f30aa3284dd1e92136ef2 @andre-d andre-d committed with spladug Dec 13, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 html/html.c
View
@@ -664,12 +664,15 @@ static void
toc_finalize(struct buf *ob, void *opaque)
{
struct html_renderopt *options = opaque;
-
+ bool has_toc = false;
while (options->toc_data.current_level > 0) {
BUFPUTSL(ob, "</li>\n</ul>\n");
options->toc_data.current_level--;
+ has_toc = true;
+ }
+ if(has_toc) {
+ BUFPUTSL(ob, "</div>\n");
}
- BUFPUTSL(ob, "</div>\n");
reset_toc(ob, opaque);
}

0 comments on commit 30fee25

Please sign in to comment.