Added support for ssh and sftp

This commit is contained in:
M66B 2020-06-21 16:05:09 +02:00
parent 41654d152e
commit 7377d1b52e
1 changed files with 5 additions and 3 deletions

View File

@ -884,16 +884,18 @@ public class HtmlHelper {
if (view) {
// https://en.wikipedia.org/wiki/List_of_URI_schemes
// ftp (generic syntax)
// fish://[<username>[:<password>]@]<hostname>[:<port>]
// telnet://<user>:<password>@<host>[:<port>/]
// ssh://[<user>[;fingerprint=<host-key fingerprint>]@]<host>[:<port>]
// sftp://[<user>[;fingerprint=<host-key fingerprint>]@]<host>[:<port>]/<path>/<file>
// fish://[<username>[:<password>]@]<hostname>[:<port>]
// xmpp:[<user>]@<host>[:<port>]/[<resource>][?<query>]
// geo:<lat>,<lon>[,<alt>][;u=<uncertainty>]
// tel:<phonenumber>
// xmpp:[<user>]@<host>[:<port>]/[<resource>][?<query>]
final Pattern pattern = Pattern.compile(
PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + "|" +
PatternsCompat.AUTOLINK_WEB_URL.pattern()
.replace("(?i:http|https|rtsp)://",
"(((?i:http|https|rtsp|ftp|fish|telnet)://)|((?i:xmpp):))") + "|" +
"(((?i:http|https|rtsp|ftp|telnet|ssh|sftp|fish)://)|((?i:xmpp):))") + "|" +
"(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)|" +
"(?i:tel:" + Patterns.PHONE.pattern() + ")");