Commit 50f707e2 authored by Robert Speicher's avatar Robert Speicher

Update Autolink SCHEME_PATTERN

parent 9ec8a5f7
...@@ -25,7 +25,9 @@ module Gitlab ...@@ -25,7 +25,9 @@ module Gitlab
# The negative lookbehind ensures that users can paste a URL followed by a # The negative lookbehind ensures that users can paste a URL followed by a
# period or comma for punctuation without those characters being included # period or comma for punctuation without those characters being included
# in the generated link. # 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 # Text matching SCHEME_PATTERN inside these elements will not be linked
IGNORE_PARENTS = %w(a code kbd pre script style).to_set IGNORE_PARENTS = %w(a code kbd pre script style).to_set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment