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)
i = 0
l = 1
inside_pre = false
@text.split(/(^(?:\S+\r?\n\r?(?:\=+|\-+)|#+.+|(?:~~~|```).*)\s*$)/).each do |part|
@text.split(/(^(?:\S+\r?\n\r?(?:\=+|\-+)|#+ +.+|(?:~~~|```).*)\s*$)/).each do |part|
level = nil
if part =~ /\A(~{3,}|`{3,})(\s*\S+)?\s*$/
if !inside_pre
......
end
elsif inside_pre
# nop
elsif part =~ /\A(#+).+/
elsif part =~ /\A(#+) +.+/
level = $1.size
elsif part =~ /\A.+\r?\n\r?(\=+|\-+)\s*$/
level = $1.include?('=') ? 1 : 2
(4-4/5)