Update Autolink SCHEME_PATTERN

This commit is contained in:
Robert Speicher 2015-04-29 14:17:29 -04:00
parent 9ec8a5f75d
commit 50f707e27a
1 changed files with 3 additions and 1 deletions

View File

@ -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