diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 7d436bb3f0..c51c03b8bf 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -60,7 +60,7 @@ import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE; public class HtmlHelper { private static final int PREVIEW_SIZE = 250; - private static Pattern pattern = Pattern.compile("https?://[\\w#%&()*+,-./:;=?@\\[\\]_|~]+"); + private static final Pattern pattern = Pattern.compile("https?://[\\w#%&()*+,\\-./:;=?@\\[\\]_|~]*[\\w#)*+\\-/=@\\]|~]"); private static final List heads = Arrays.asList("h1", "h2", "h3", "h4", "h5", "h6", "p", "table", "ol", "ul", "br", "hr"); private static final List tails = Arrays.asList("h1", "h2", "h3", "h4", "h5", "h6", "p", "ol", "ul", "li"); diff --git a/app/src/test/java/eu/faircode/email/HtmlHelperTest.java b/app/src/test/java/eu/faircode/email/HtmlHelperTest.java index 21f804b400..4e91540515 100644 --- a/app/src/test/java/eu/faircode/email/HtmlHelperTest.java +++ b/app/src/test/java/eu/faircode/email/HtmlHelperTest.java @@ -13,10 +13,10 @@ class HtmlHelperTest { "To visit http://www.example.org, go to http://www.example.org.", "" + - // FIXME: The trailing comma must not be part of the URL. - "To visit http://www.example.org, " + - // FIXME: The trailing dot must not be part of the URL. - "go to http://www.example.org."); + // The trailing comma must not be part of the URL. + "To visit http://www.example.org, " + + // The trailing dot must not be part of the URL. + "go to http://www.example.org."); testAutolink( "one hhhhh|spt://example.org three",