mirror of https://github.com/M66B/FairEmail.git
Improved geo link pattern
This commit is contained in:
parent
c72a5194c2
commit
2baa11161d
|
@ -1543,6 +1543,8 @@ public class HtmlHelper {
|
||||||
|
|
||||||
static void autoLink(Document document, boolean outbound) {
|
static void autoLink(Document document, boolean outbound) {
|
||||||
// https://en.wikipedia.org/wiki/List_of_URI_schemes
|
// https://en.wikipedia.org/wiki/List_of_URI_schemes
|
||||||
|
// https://en.wikipedia.org/wiki/Geo_URI_scheme
|
||||||
|
// https://developers.google.com/maps/documentation/urls/android-intents
|
||||||
// xmpp:[<user>]@<host>[:<port>]/[<resource>][?<query>]
|
// xmpp:[<user>]@<host>[:<port>]/[<resource>][?<query>]
|
||||||
// geo:<lat>,<lon>[,<alt>][;u=<uncertainty>]
|
// geo:<lat>,<lon>[,<alt>][;u=<uncertainty>]
|
||||||
// tel:<phonenumber>
|
// tel:<phonenumber>
|
||||||
|
@ -1555,7 +1557,10 @@ public class HtmlHelper {
|
||||||
.replace("(?i:http|https|rtsp)://",
|
.replace("(?i:http|https|rtsp)://",
|
||||||
"(((?i:http|https)://)|((?i:xmpp):))") +
|
"(((?i:http|https)://)|((?i:xmpp):))") +
|
||||||
"|" +
|
"|" +
|
||||||
"(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)" +
|
"(?i:geo:(-?\\d+(\\.\\d+)?),(-?\\d+(\\.\\d+)?)(,-?\\d+(\\.\\d+)?)?" +
|
||||||
|
"(;u=\\d+)?" + // Uncertainty
|
||||||
|
"(\\?z=\\d+)?" + // Zoom
|
||||||
|
"(\\?q=.+)?)" + // Google Maps query
|
||||||
"|" +
|
"|" +
|
||||||
"(?i:tel:" + Patterns.PHONE.pattern() + ")" +
|
"(?i:tel:" + Patterns.PHONE.pattern() + ")" +
|
||||||
(BuildConfig.DEBUG ? "|(" + GPA_PATTERN + ")" : ""));
|
(BuildConfig.DEBUG ? "|(" + GPA_PATTERN + ")" : ""));
|
||||||
|
|
Loading…
Reference in New Issue