From 8cc56cce6683c52c3faea6ce90abd907e117152c 2012-09-06 17:21:09 From: Jean-Philippe Lang Date: 2012-09-06 17:21:09 Subject: [PATCH] Merged r10294 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@10297 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0e12d51..2ab208b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -799,7 +799,7 @@ module ApplicationHelper end end - HEADING_RE = /(]+)?>(.+?)<\/h(1|2|3|4)>)/i unless const_defined?(:HEADING_RE) + HEADING_RE = /(]+)?>(.+?)<\/h(\d)>)/i unless const_defined?(:HEADING_RE) def parse_sections(text, project, obj, attr, only_path, options) return unless options[:edit_section_links] @@ -870,6 +870,8 @@ module ApplicationHelper # Renders the TOC with given headings def replace_toc(text, headings) text.gsub!(TOC_RE) do + # Keep only the 4 first levels + headings = headings.select{|level, anchor, item| level <= 4} if headings.empty? '' else diff --git a/doc/CHANGELOG b/doc/CHANGELOG index cd8b270..ba956b8 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -11,6 +11,7 @@ http://www.redmine.org/ * Defect #11307: Can't filter for negative numeric custom fields * Defect #11365: Attachment description length is not validated * Defect #11541: Version sharing is missing in the REST API +* Defect #11789: Edit section links broken with h5/h6 headings * Feature #11338: Exclude emails with auto-submitted => auto-generated * Patch #11328: Fix Japanese mistranslation for 'label_language_based' * Patch #11448: Russian translation for 1.4-stable and 2.0-stable