Patch by daijiro fukuda (user:daipom).
git-svn-id: https://svn.redmine.org/redmine/trunk@22906
e93f8b46-1217-0410-a6f0-
8f06a7374b81
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