diff --git a/lib/unique_head.rb b/lib/unique_head.rb index 9c26790..1dbf518 100644 --- a/lib/unique_head.rb +++ b/lib/unique_head.rb @@ -6,7 +6,7 @@ class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML @head_count = {} end def header(text, header_level) - friendly_text = text.parameterize + friendly_text = text.gsub(/<[^<]+>/,"").parameterize @head_count[friendly_text] ||= 0 @head_count[friendly_text] += 1 if @head_count[friendly_text] > 1 diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index bb0943e..9094db5 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -72,12 +72,12 @@ under the License.
<% toc_data(page_content).each do |h1| %>
  • - <%= h1[:content] %> + <%= h1[:content] %> <% if h1[:children].length > 0 %>