@@ -47,7 +47,7 module Redmine | |||||
47 | if tag =~ /^h(\d)$/ |
|
47 | if tag =~ /^h(\d)$/ | |
48 | @toc << [$1.to_i, content] |
|
48 | @toc << [$1.to_i, content] | |
49 | end |
|
49 | end | |
50 |
content = "<a name=\"#{@toc.length} |
|
50 | content = "<a name=\"#{@toc.length}\" class=\"wiki-page\"></a>" + content | |
51 | textile_p(tag, atts, cite, content) |
|
51 | textile_p(tag, atts, cite, content) | |
52 | end |
|
52 | end | |
53 |
|
53 | |||
@@ -61,7 +61,9 module Redmine | |||||
61 | div_class << ' right' if $1 == '>' |
|
61 | div_class << ' right' if $1 == '>' | |
62 | out = "<div class=\"#{div_class}\">" |
|
62 | out = "<div class=\"#{div_class}\">" | |
63 | @toc.each_with_index do |heading, index| |
|
63 | @toc.each_with_index do |heading, index| | |
64 | out << "<a href=\"##{index+1}-#{heading.last}\" class=\"heading#{heading.first}\">#{heading.last}</a>" |
|
64 | # remove wiki links from the item | |
|
65 | toc_item = heading.last.gsub(/(\[\[|\]\])/, '') | |||
|
66 | out << "<a href=\"##{index+1}\" class=\"heading#{heading.first}\">#{toc_item}</a>" | |||
65 | end |
|
67 | end | |
66 | out << '</div>' |
|
68 | out << '</div>' | |
67 | out |
|
69 | out |
General Comments 0
You need to be logged in to leave comments.
Login now