Skip to content

Commit

Permalink
Fixed a bug (or is it just a change of opinion since I first wrote it…
Browse files Browse the repository at this point in the history
…?) where the outline filter would add numbering to headers that are excluded from the table of contents range. Now the outline numbering matches the ToC generation.
  • Loading branch information
TwP committed Aug 25, 2008
1 parent 32afc2b commit 7b620d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/webby/filters/outline.rb
Expand Up @@ -132,7 +132,8 @@ def filter
@toc_range = Integer(m[1])..Integer(m[2])
@list_opening = build_list_opening(toc_elem)

doc.traverse_element(*%w[h1 h2 h3 h4 h5 h6]) do |elem|
headers = @toc_range.map {|x| "h#{x}"}
doc.traverse_element(*headers) do |elem|
text, id = heading_info(elem)
add_to_toc(text, id) if @toc_range.include? current_level
end
Expand Down

0 comments on commit 7b620d4

Please sign in to comment.