Skip to content

Commit

Permalink
fix level handling of mytoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Jan 12, 2011
1 parent 6c5efdb commit f70c070
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Wed Jan 12 23:49:05 2011 Kenshi Muto <kmuto@debian.org>

* lib/epubmaker/epubv2.rb: fix level handling of mytoc.

Mon Dec 20 23:41:04 2010 Kenshi Muto <kmuto@debian.org>

* lib/epubmaker/epubv2.rb: fix indent.
Expand Down
5 changes: 4 additions & 1 deletion lib/epubmaker/epubv2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ def mytoc
s << %Q[\n<ul class="toc-h#{item.level}">\n]
current = item.level
elsif item.level < current
s << %Q[</li>\n</ul>\n</li>\n]
(current - 1).downto(item.level) do |n|
s << %Q[</li>\n</ul>\n]
end
s << %Q[</li>\n]
current = item.level
elsif init_item
# noop
Expand Down

0 comments on commit f70c070

Please sign in to comment.