From f4e0c77c8357958e713466c000e135e321600249 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 16 Jun 2008 19:37:09 +0000 Subject: [PATCH] Prevent unwanted textile link parsing at end of line. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1557 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redcloth.rb | 2 +- test/unit/helpers/application_helper_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/redcloth.rb b/lib/redcloth.rb index 42eddd8e04..59d02fbab3 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -786,7 +786,7 @@ class RedCloth < String \s? (?:\(([^)]+?)\)(?="))? # $title ": - (\S+?) # $url + ([\w\/]\S+?) # $url (\/)? # $slash ([^\w\/;]*?) # $post (?=<|\s|$) diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 7fa96d7e27..c6afdda0e4 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -59,6 +59,7 @@ class ApplicationHelperTest < HelperTestCase 'This is a "link":http://foo.bar' => 'This is a link', 'This is an intern "link":/foo/bar' => 'This is an intern link', '"link (Link title)":http://foo.bar' => 'link', + "This is not a \"Link\":\n\nAnother paragraph" => "This is not a \"Link\":

\n\n\n\t

Another paragraph", # no multiline link text "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line
\nand another on a second line\":test" }