PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' )
PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' )
PUNCT_Q = Regexp::quote( '*-_+^~%' )
- HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)'
+ HYPERLINK = '(?=\/|https?:\/\/|s?ftps?:\/\/|www\.|mailto:)(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)'
# Text markup tags, don't conflict with block tags
SIMPLE_HTML_TAGS = [
(?:\(([^)]+?)\)(?="))? # $title
":
( # $url
- (\/|[a-zA-Z]+:\/\/|www\.|mailto:) # $proto
+ (\/|https?:\/\/|s?ftps?:\/\/|www\.|mailto:) # $proto
[[:alnum:]_\/]\S+?
)
(\/)? # $slash