Fixed: Cannot edit a wiki section which title starts with a tab (#12799).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11159 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
18061b641f
commit
956239fc85
|
@ -69,7 +69,7 @@ module Redmine
|
||||||
l = 1
|
l = 1
|
||||||
started = false
|
started = false
|
||||||
ended = false
|
ended = false
|
||||||
text.scan(/(((?:.*?)(\A|\r?\n\s*\r?\n))(h(\d+)(#{A}#{C})\.(?::(\S+))? (.*?)$)|.*)/m).each do |all, content, lf, heading, level|
|
text.scan(/(((?:.*?)(\A|\r?\n\s*\r?\n))(h(\d+)(#{A}#{C})\.(?::(\S+))?[ \t](.*?)$)|.*)/m).each do |all, content, lf, heading, level|
|
||||||
if heading.nil?
|
if heading.nil?
|
||||||
if ended
|
if ended
|
||||||
after << all
|
after << all
|
||||||
|
|
|
@ -419,6 +419,20 @@ STR
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_get_section_should_support_headings_starting_with_a_tab
|
||||||
|
text = <<-STR
|
||||||
|
h1.\tHeading 1
|
||||||
|
|
||||||
|
Content 1
|
||||||
|
|
||||||
|
h1. Heading 2
|
||||||
|
|
||||||
|
Content 2
|
||||||
|
STR
|
||||||
|
|
||||||
|
assert_match /\Ah1.\tHeading 1\s+Content 1\z/, @formatter.new(text).get_section(1).first
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def assert_html_output(to_test, expect_paragraph = true)
|
def assert_html_output(to_test, expect_paragraph = true)
|
||||||
|
|
Loading…
Reference in New Issue