summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/redmine/wiki_formatting.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 2bfbdf1d8..623f2491f 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -47,7 +47,7 @@ module Redmine
if tag =~ /^h(\d)$/
@toc << [$1.to_i, content]
end
- content = "<a name=\"#{@toc.length}-#{content}\" class=\"wiki-page\"></a>" + content
+ content = "<a name=\"#{@toc.length}\" class=\"wiki-page\"></a>" + content
textile_p(tag, atts, cite, content)
end
@@ -61,7 +61,9 @@ module Redmine
div_class << ' right' if $1 == '>'
out = "<div class=\"#{div_class}\">"
@toc.each_with_index do |heading, index|
- out << "<a href=\"##{index+1}-#{heading.last}\" class=\"heading#{heading.first}\">#{heading.last}</a>"
+ # remove wiki links from the item
+ toc_item = heading.last.gsub(/(\[\[|\]\])/, '')
+ out << "<a href=\"##{index+1}\" class=\"heading#{heading.first}\">#{toc_item}</a>"
end
out << '</div>'
out