diff --git a/src/com/fsck/k9/helper/HtmlConverter.java b/src/com/fsck/k9/helper/HtmlConverter.java index e17d3ed23..4ad398fc4 100644 --- a/src/com/fsck/k9/helper/HtmlConverter.java +++ b/src/com/fsck/k9/helper/HtmlConverter.java @@ -392,7 +392,9 @@ public class HtmlConverter { * @param outputBuffer Buffer to append linked text to. */ private static void linkifyText(final String text, final StringBuffer outputBuffer) { - Matcher m = Regex.WEB_URL_PATTERN.matcher(text); + String prepared = text.replaceAll(Regex.BITCOIN_URI_PATTERN, "$0"); + + Matcher m = Regex.WEB_URL_PATTERN.matcher(prepared); while (m.find()) { int start = m.start(); if (start == 0 || (start != 0 && text.charAt(start - 1) != '@')) { diff --git a/src/com/fsck/k9/helper/Regex.java b/src/com/fsck/k9/helper/Regex.java index 8eb3765b8..dd60134a0 100644 --- a/src/com/fsck/k9/helper/Regex.java +++ b/src/com/fsck/k9/helper/Regex.java @@ -103,4 +103,7 @@ public class Regex { "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" + ")+" ); + + public static final String BITCOIN_URI_PATTERN = + "bitcoin:[1-9a-km-zA-HJ-NP-Z]{27,34}(\\?[a-zA-Z0-9$\\-_.+!*'(),%:@&=]*)?"; }