##// END OF EJS Templates
Merged r9822 from trunk....
Jean-Philippe Lang -
r9657:081ee54bee62
parent child
Show More
@@ -69,7 +69,7 module Redmine
69 l = 1
69 l = 1
70 started = false
70 started = false
71 ended = false
71 ended = false
72 text.scan(/(((?:.*?)(\A|\r?\n\r?\n))(h(\d+)(#{A}#{C})\.(?::(\S+))? (.*?)$)|.*)/m).each do |all, content, lf, heading, level|
72 text.scan(/(((?:.*?)(\A|\r?\n\s*\r?\n))(h(\d+)(#{A}#{C})\.(?::(\S+))? (.*?)$)|.*)/m).each do |all, content, lf, heading, level|
73 if heading.nil?
73 if heading.nil?
74 if ended
74 if ended
75 after << all
75 after << all
@@ -394,6 +394,31 Nulla nunc nisi, egestas in ornare vel, posuere ac libero."]
394 @formatter.new(text).update_section(3, replacement)
394 @formatter.new(text).update_section(3, replacement)
395 end
395 end
396
396
397 def test_get_section_should_support_lines_with_spaces_before_heading
398 # the lines after Content 2 and Heading 4 contain a space
399 text = <<-STR
400 h1. Heading 1
401
402 Content 1
403
404 h1. Heading 2
405
406 Content 2
407
408 h1. Heading 3
409
410 Content 3
411
412 h1. Heading 4
413
414 Content 4
415 STR
416
417 [1, 2, 3, 4].each do |index|
418 assert_match /\Ah1. Heading #{index}.+Content #{index}/m, @formatter.new(text).get_section(index).first
419 end
420 end
421
397 private
422 private
398
423
399 def assert_html_output(to_test, expect_paragraph = true)
424 def assert_html_output(to_test, expect_paragraph = true)
General Comments 0
You need to be logged in to leave comments. Login now