Fixed: TOC does not remove colorization markups (#1423).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1542 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-06-15 11:00:40 +00:00
1 parent 8b2105e20a
commit 11e9891425
2 files changed
+31

No files matched your search

+3
View File
@@ -85,6 +85,9 @@ module Redmine
@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>"
end
out << '</div>'