summaryrefslogtreecommitdiffstats
path: root/lib/redmine/wiki_formatting.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 19:40:47 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-22 19:40:47 +0000
commit5564dfbbd5a31362fde86f27ac8beccd1661d6f8 (patch)
tree8a622876dd84409112a3d794f9c92b48aaf4d7bf /lib/redmine/wiki_formatting.rb
parenta17b62b455188208dccd38b312fb40d39c515757 (diff)
downloadredmine-5564dfbbd5a31362fde86f27ac8beccd1661d6f8.tar.gz
redmine-5564dfbbd5a31362fde86f27ac8beccd1661d6f8.zip
TOC rendered as an unordered list.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1693 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting.rb')
-rw-r--r--lib/redmine/wiki_formatting.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 952f636d3..11ec6803a 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -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