From 985634ef9e647fc48a07241924b9e2586e448cb4 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 12 Mar 2016 10:36:10 +0000 Subject: [PATCH] Merged r15136 to r15138 (#21593). git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15222 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 ++-- test/unit/helpers/application_helper_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f152e217b..779b6b89f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -883,12 +883,12 @@ module ApplicationHelper def parse_sections(text, project, obj, attr, only_path, options) return unless options[:edit_section_links] text.gsub!(HEADING_RE) do - heading = $1 + heading, level = $1, $2 @current_section += 1 if @current_section > 1 content_tag('div', link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)), - :class => 'contextual', + :class => "contextual heading-#{level}", :title => l(:button_edit_section), :id => "section-#{@current_section}") + heading.html_safe else diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 6b0d1c7d3..949b08b8b 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1242,14 +1242,14 @@ RAW result = textilizable(raw, :edit_section_links => {:controller => 'wiki', :action => 'edit', :project_id => '1', :id => 'Test'}).gsub("\n", "") # heading that contains inline code - assert_match Regexp.new('
' + + assert_match Regexp.new('
' + 'Edit
' + '' + '

Subtitle with inline code

'), result # last heading - assert_match Regexp.new('
' + + assert_match Regexp.new('
' + 'Edit
' + '' + '

Subtitle after pre tag

'), -- 2.39.5