summaryrefslogtreecommitdiffstats
path: root/lib/redmine/wiki_formatting.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-27 19:44:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-27 19:44:23 +0000
commite1bb4a5baa34343b94d8858b8df036f2814f6389 (patch)
tree134e1466dd50a83cbcfce6bf9d168d9eedd63739 /lib/redmine/wiki_formatting.rb
parent20aff7cc7077650c2021b8bab27a87e5b6cf0d9d (diff)
downloadredmine-e1bb4a5baa34343b94d8858b8df036f2814f6389.tar.gz
redmine-e1bb4a5baa34343b94d8858b8df036f2814f6389.zip
Fixed: Links to other wiki pages in headings get corrupted (class attributes shown).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@769 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting.rb')
-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