From 7e4f975edb5bad9f4a9d9821b2cac58a22fbb8cc Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 16 Feb 2022 16:07:25 +0100 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index d55c50aa3c..1e3c4c233a 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -1355,11 +1355,14 @@ public class HtmlHelper { // tel: final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}"); final Pattern pattern = Pattern.compile( - "(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" + + "(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")" + + "|" + PatternsCompat.AUTOLINK_WEB_URL.pattern() .replace("(?i:http|https|rtsp)://", - "(((?i:http|https)://)|((?i:xmpp):))") + "|" + - "(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)|" + + "(((?i:http|https)://)|((?i:xmpp):))") + + "|" + + "(?i:geo:\\d+,\\d+(,\\d+)?(;u=\\d+)?)" + + "|" + "(?i:tel:" + Patterns.PHONE.pattern() + ")" + (BuildConfig.DEBUG ? "|(" + GPA_PATTERN + ")" : ""));