]> source.dussan.org Git - redmine.git/commitdiff
Merged r13592, r13594, r13599 (#18349).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 10:41:00 +0000 (10:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 10:41:00 +0000 (10:41 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13632 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting.rb
test/unit/lib/redmine/wiki_formatting_test.rb

index 284cdc933de17b8e76d517e4d584fd469a6ff7ea..408dd7ca141bf70a283f10517b3aeb279fce7db4 100644 (file)
@@ -94,7 +94,7 @@ module Redmine
     module LinksHelper
       AUTO_LINK_RE = %r{
                       (                          # leading text
-                        <\w+.*?>|                # leading HTML tag, or
+                        <\w+[^>]*?>|             # leading HTML tag, or
                         [\s\(\[,;]|              # leading punctuation, or
                         ^                        # beginning of line
                       )
index 830ab20ca136d006c056b384a3c649e3e6b778aa..05c0f5e1d4311c1c5eb95001090f32439f938c55 100644 (file)
@@ -48,6 +48,19 @@ EXPECTED
     assert_equal expected.gsub(%r{[\r\n\t]}, ''), Redmine::WikiFormatting::NullFormatter::Formatter.new(raw).to_html.gsub(%r{[\r\n\t]}, '')
   end
 
+  def test_links_separated_with_line_break_should_link
+    raw = <<-DIFF
+link: https://www.redmine.org
+http://www.redmine.org
+DIFF
+
+    expected = <<-EXPECTED
+<p>link: <a class="external" href="https://www.redmine.org">https://www.redmine.org</a><br />
+<a class="external" href="http://www.redmine.org">http://www.redmine.org</a></p>
+EXPECTED
+    
+  end
+
   def test_supports_section_edit
     with_settings :text_formatting => 'textile' do
       assert_equal true, Redmine::WikiFormatting.supports_section_edit?