Merge "Add "ftp" to the list of URL schemes that get linkified."

This commit is contained in:
Fredrik Roubert
2020-04-01 19:02:51 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -303,7 +303,7 @@ public class Linkify {
if ((mask & WEB_URLS) != 0) { if ((mask & WEB_URLS) != 0) {
gatherLinks(links, text, Patterns.AUTOLINK_WEB_URL, gatherLinks(links, text, Patterns.AUTOLINK_WEB_URL,
new String[] { "http://", "https://", "rtsp://" }, new String[] { "http://", "https://", "rtsp://", "ftp://" },
sUrlMatchFilter, null); sUrlMatchFilter, null);
} }

View File

@@ -301,7 +301,7 @@ public class Patterns {
private static final String DOMAIN_NAME_STR = "(" + HOST_NAME + "|" + IP_ADDRESS_STRING + ")"; private static final String DOMAIN_NAME_STR = "(" + HOST_NAME + "|" + IP_ADDRESS_STRING + ")";
public static final Pattern DOMAIN_NAME = Pattern.compile(DOMAIN_NAME_STR); public static final Pattern DOMAIN_NAME = Pattern.compile(DOMAIN_NAME_STR);
private static final String PROTOCOL = "(?i:http|https|rtsp)://"; private static final String PROTOCOL = "(?i:http|https|rtsp|ftp)://";
/* A word boundary or end of input. This is to stop foo.sure from matching as foo.su */ /* A word boundary or end of input. This is to stop foo.sure from matching as foo.su */
private static final String WORD_BOUNDARY = "(?:\\b|$|^)"; private static final String WORD_BOUNDARY = "(?:\\b|$|^)";