]> source.dussan.org Git - redmine.git/commitdiff
Prevent issue links with double hash (##nnn) from being recognized as ATX headings...
authorGo MAEDA <maeda@farend.jp>
Sat, 6 Jul 2024 07:44:05 +0000 (07:44 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 6 Jul 2024 07:44:05 +0000 (07:44 +0000)
Patch by daijiro fukuda (user:daipom).

git-svn-id: https://svn.redmine.org/redmine/trunk@22906 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/section_helper.rb

index bc8b1a9bce64782b59467a91fd33b88033ed937e..44052c9e68885004cc96928b767057d9abc2dfa9 100644 (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
@@ -52,7 +52,7 @@ module Redmine
             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