Project

General

Profile

Defect #40716 » wiki-fix-section-extracting-mishandles-ticket-refs.diff

patch explaned in the ticket description - daijiro fukuda, 2024-05-22 05:25

View differences:

lib/redmine/wiki_formatting/section_helper.rb (working copy)
42 42
        i = 0
43 43
        l = 1
44 44
        inside_pre = false
45
        @text.split(/(^(?:\S+\r?\n\r?(?:\=+|\-+)|#+.+|(?:~~~|```).*)\s*$)/).each do |part|
45
        @text.split(/(^(?:\S+\r?\n\r?(?:\=+|\-+)|#+ +.+|(?:~~~|```).*)\s*$)/).each do |part|
46 46
          level = nil
47 47
          if part =~ /\A(~{3,}|`{3,})(\s*\S+)?\s*$/
48 48
            if !inside_pre
......
52 52
            end
53 53
          elsif inside_pre
54 54
            # nop
55
          elsif part =~ /\A(#+).+/
55
          elsif part =~ /\A(#+) +.+/
56 56
            level = $1.size
57 57
          elsif part =~ /\A.+\r?\n\r?(\=+|\-+)\s*$/
58 58
            level = $1.include?('=') ? 1 : 2
(4-4/5)