@@ -883,12 +883,12 module ApplicationHelper | |||
|
883 | 883 | def parse_sections(text, project, obj, attr, only_path, options) |
|
884 | 884 | return unless options[:edit_section_links] |
|
885 | 885 | text.gsub!(HEADING_RE) do |
|
886 | heading = $1 | |
|
886 | heading, level = $1, $2 | |
|
887 | 887 | @current_section += 1 |
|
888 | 888 | if @current_section > 1 |
|
889 | 889 | content_tag('div', |
|
890 | 890 | link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)), |
|
891 |
:class => |
|
|
891 | :class => "contextual heading-#{level}", | |
|
892 | 892 | :title => l(:button_edit_section), |
|
893 | 893 | :id => "section-#{@current_section}") + heading.html_safe |
|
894 | 894 | else |
@@ -1242,14 +1242,14 RAW | |||
|
1242 | 1242 | result = textilizable(raw, :edit_section_links => {:controller => 'wiki', :action => 'edit', :project_id => '1', :id => 'Test'}).gsub("\n", "") |
|
1243 | 1243 | |
|
1244 | 1244 | # heading that contains inline code |
|
1245 | assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-4">' + | |
|
1245 | assert_match Regexp.new('<div class="contextual heading-2" title="Edit this section" id="section-4">' + | |
|
1246 | 1246 | '<a href="/projects/1/wiki/Test/edit\?section=4"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' + |
|
1247 | 1247 | '<a name="Subtitle-with-inline-code"></a>' + |
|
1248 | 1248 | '<h2 >Subtitle with <code>inline code</code><a href="#Subtitle-with-inline-code" class="wiki-anchor">¶</a></h2>'), |
|
1249 | 1249 | result |
|
1250 | 1250 | |
|
1251 | 1251 | # last heading |
|
1252 | assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-5">' + | |
|
1252 | assert_match Regexp.new('<div class="contextual heading-2" title="Edit this section" id="section-5">' + | |
|
1253 | 1253 | '<a href="/projects/1/wiki/Test/edit\?section=5"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' + |
|
1254 | 1254 | '<a name="Subtitle-after-pre-tag"></a>' + |
|
1255 | 1255 | '<h2 >Subtitle after pre tag<a href="#Subtitle-after-pre-tag" class="wiki-anchor">¶</a></h2>'), |
General Comments 0
You need to be logged in to leave comments.
Login now