]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Cannot edit a wiki section which title starts with a tab (#12799).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jan 2013 22:05:22 +0000 (22:05 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jan 2013 22:05:22 +0000 (22:05 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11159 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/formatter.rb
test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb

index b06ee64e781dac61b09e612f72aa352ce238fef1..8fc8e3448e7cbf5d7dc5910c7b4bbd09cc482b15 100644 (file)
@@ -69,7 +69,7 @@ module Redmine
           l = 1
           started = 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 ended
                 after << all
index 26f9993d0d11139966a7d08dd4d7a196a24a1980..88242f54f3e0e021ede1c2d6a94191d1cff3c8f7 100644 (file)
@@ -419,6 +419,20 @@ STR
     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
 
   def assert_html_output(to_test, expect_paragraph = true)