mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
TOC rendered as an unordered list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1693 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -81,16 +81,16 @@ module Redmine
|
||||
div_class = 'toc'
|
||||
div_class << ' right' if $1 == '>'
|
||||
div_class << ' left' if $1 == '<'
|
||||
out = "<div class=\"#{div_class}\">"
|
||||
out = "<ul class=\"#{div_class}\">"
|
||||
@toc.each_with_index do |heading, index|
|
||||
# remove wiki links from the item
|
||||
toc_item = heading.last.gsub(/(\[\[|\]\])/, '')
|
||||
# remove styles
|
||||
# eg. %{color:red}Triggers% => Triggers
|
||||
toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
|
||||
out << "<a href=\"##{index+1}\" class=\"heading#{heading.first}\">#{toc_item}</a>"
|
||||
out << "<li class=\"heading#{heading.first}\"><a href=\"##{index+1}\">#{toc_item}</a></li>\n"
|
||||
end
|
||||
out << '</div>'
|
||||
out << '</ul>'
|
||||
out
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user