1<% comment = if current.respond_to? :comment_location then
2               current.comment_location
3             else
4               current.comment
5             end
6   table = current.parse(comment).table_of_contents
7
8   if table.length > 1 then %>
9<div id="table-of-contents">
10  <nav class="section">
11    <h3 class="section-header">Table of Contents</h3>
12    <ul>
13<%   table.each do |heading| %>
14      <li><a href="#<%= heading.aref %>"><%= heading.plain_html %></a>
15<%   end %>
16    </ul>
17  </nav>
18</div>
19<% end %>
20