diff options
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | doc/CHANGELOG | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0e12d51ee..2ab208b15 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)( [^>]+)?>(.+?)<\/h(1|2|3|4)>)/i unless const_defined?(:HEADING_RE) + HEADING_RE = /(<h(\d)( [^>]+)?>(.+?)<\/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 cd8b2703f..ba956b8ba 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 |