diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-14 20:18:09 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-14 20:18:09 +0000 |
commit | c12ba8a76cfa54b2f980017a1ca4a5d28bf8ce5d (patch) | |
tree | f3e15f07feec5aec1f8e8f5830070cafbe8223b8 /lib | |
parent | 429e266bef42b9cdae23ccfe2375f1cf42865fc1 (diff) | |
download | redmine-c12ba8a76cfa54b2f980017a1ca4a5d28bf8ce5d.tar.gz redmine-c12ba8a76cfa54b2f980017a1ca4a5d28bf8ce5d.zip |
Fixed that URLs separated by line break are not rendered as links (#18349).
git-svn-id: http://svn.redmine.org/redmine/trunk@13592 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/wiki_formatting.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index 284cdc933..b1085a74a 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -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 ) @@ -113,8 +113,12 @@ module Redmine # Destructively replaces urls into clickable links def auto_link!(text) + Rails.logger.debug "=====================" + Rails.logger.debug text + Rails.logger.debug "=====================" text.gsub!(AUTO_LINK_RE) do all, leading, proto, url, post = $&, $1, $2, $3, $6 + Rails.logger.debug all if leading =~ /<a\s/i || leading =~ /![<>=]?/ # don't replace URLs that are already linked # and URLs prefixed with ! !> !< != (textile images) |