Commit 9983d3cd authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Skip TOC when less than 2 sections.

parent aa5521f8
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -80,9 +80,13 @@ module JsDuck
      end
      toc << "</ol>\n"
      toc << "</div>\n"
      # Inject TOC at below first heading
      # Inject TOC at below first heading if at least 2 items in TOC
      if i >= 2
        new_html.insert(1, toc)
        new_html.flatten.join
      else
        html
      end
    end

    # Returns all guides as array