<% if !anchor.nil? %>
  <a name="<%= anchor %>">
<% end %>
<div class="sect<%= level %>">
  <h<%= level + 1 %> id="<%= section_id %>"><%= name %></h<%= level + 1 %>>
  <% if !anchor.nil? %>
    </a>
  <% end %>
  <% if level == 1 %>
    <div class="sectionbody"><%= content %></div>
  <% else %>
    <%= content %>
  <% end %>
</div>

<div class="sect<%= level %>">
  <% if !anchor.nil? %>
    <a name='<%= anchor %>'></a>
  <% end %>
  <h<%= level + 1 %> id="<%= section_id %>"><%= name %></h<%= level + 1 %>>
  <% if level == 1 %>
    <div class="sectionbody"><%= content %></div>
  <% else %>
    <%= content %>
  <% end %>
</div>

Fix anchor href rendering for Section anchors
Fix anchor href rendering for Section anchors
