summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-07-10 09:33:48 +0000
committerGo MAEDA <maeda@farend.jp>2024-07-10 09:33:48 +0000
commitf5768f9252ee04adfa06bdc7d9b6f56370892970 (patch)
tree35c7c8a448fd4b2de9623ad167dc4899020f0b3d /lib
parent0f8c613975271fd52dfc085719257ea97651326c (diff)
downloadredmine-f5768f9252ee04adfa06bdc7d9b6f56370892970.tar.gz
redmine-f5768f9252ee04adfa06bdc7d9b6f56370892970.zip
Merged r22905, r22906, and r22907 from trunk to 5.1-stable (#40716).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22918 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/wiki_formatting/section_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting/section_helper.rb b/lib/redmine/wiki_formatting/section_helper.rb
index 9221d990d..7d0b974de 100644
--- a/lib/redmine/wiki_formatting/section_helper.rb
+++ b/lib/redmine/wiki_formatting/section_helper.rb
@@ -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,9 +52,9 @@ module Redmine
end
elsif inside_pre
# nop
- elsif part =~ /\A(#+).+/
+ elsif part =~ /\A(#+) .+/
level = $1.size
- elsif part =~ /\A.+\r?\n\r?(\=+|\-+)\s*$/
+ elsif part =~ /\A.+\r?\n\r?(=+|-+)\s*$/
level = $1.include?('=') ? 1 : 2
end
if level