Fixes Wiki "Edit this section" does not extract SeText headings correctly in CommonMark Markdown (#40918).

git-svn-id: https://svn.redmine.org/redmine/trunk@24434 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2026-02-19 04:24:12 +00:00
parent 59619979fe
commit da22e51b35
2 changed files with 34 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ module Redmine
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