diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9751b8644..827569eb2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -492,11 +492,14 @@ module ApplicationHelper @parsed_headings = [] @heading_anchors = {} @current_section = 0 if options[:edit_section_links] + + parse_sections(text, project, obj, attr, only_path, options) text = parse_non_pre_blocks(text) do |text| - [:parse_sections, :parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_macros, :parse_headings].each do |method_name| + [:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_macros].each do |method_name| send method_name, text, project, obj, attr, only_path, options end end + parse_headings(text, project, obj, attr, only_path, options) if @parsed_headings.any? replace_toc(text, @parsed_headings) diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index ed5d5b5e2..c5d644cf7 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -732,6 +732,8 @@ some code h3. Subtitle with *some* _modifiers_ +h3. Subtitle with @inline code@ + h1. Another title h3. An "Internet link":http://www.redmine.org/ inside subtitle @@ -748,6 +750,7 @@ RAW '
+some code + +h2. heading inside pre + ++ +h2. Subtitle after pre tag +RAW + + @project = Project.find(1) + set_language_if_valid 'en' + 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('' + + '' + + 'html heading inside pre
+
inline code
¶