summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-29 14:17:29 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-30 16:35:26 -0400
commit50f707e27ade6952b87aef86714f056dea2a1da3 (patch)
treede36a415df940537652a463bdb6a22845f4721e0 /lib
parent9ec8a5f75d05a9911a1d479a8817b2c348ad91c6 (diff)
downloadgitlab-ce-50f707e27ade6952b87aef86714f056dea2a1da3.tar.gz
Update Autolink SCHEME_PATTERN
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown/autolink_filter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/markdown/autolink_filter.rb b/lib/gitlab/markdown/autolink_filter.rb
index 97cfc1893ad..9889d6643ab 100644
--- a/lib/gitlab/markdown/autolink_filter.rb
+++ b/lib/gitlab/markdown/autolink_filter.rb
@@ -25,7 +25,9 @@ module Gitlab
# The negative lookbehind ensures that users can paste a URL followed by a
# period or comma for punctuation without those characters being included
# in the generated link.
- SCHEME_PATTERN = %r{([a-z][a-z0-9_\+\.\-]+:\/\/[^\s]+)(?<!,|\.)}
+ #
+ # Rubular: http://rubular.com/r/cxjPyZc7Sb
+ SCHEME_PATTERN = %r{([a-z][a-z0-9\+\.-]+://\S+)(?<!,|\.)}
# Text matching SCHEME_PATTERN inside these elements will not be linked
IGNORE_PARENTS = %w(a code kbd pre script style).to_set