diff --git a/src/com/fsck/k9/helper/HtmlConverter.java b/src/com/fsck/k9/helper/HtmlConverter.java index 4ad398fc4..3ca48580d 100644 --- a/src/com/fsck/k9/helper/HtmlConverter.java +++ b/src/com/fsck/k9/helper/HtmlConverter.java @@ -391,7 +391,7 @@ public class HtmlConverter { * @param text Plain text to be linkified. * @param outputBuffer Buffer to append linked text to. */ - private static void linkifyText(final String text, final StringBuffer outputBuffer) { + protected static void linkifyText(final String text, final StringBuffer outputBuffer) { String prepared = text.replaceAll(Regex.BITCOIN_URI_PATTERN, "$0"); Matcher m = Regex.WEB_URL_PATTERN.matcher(prepared); diff --git a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java index ed0c876c9..c79958150 100644 --- a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java +++ b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java @@ -167,4 +167,18 @@ public class HtmlConverterTest extends TestCase { + "" + "", result); } + + public void testLinkifyBitcoinAndHttpUri() { + String text = "bitcoin:19W6QZkx8SYPG7BBCS7odmWGRxqRph5jFU http://example.com/"; + + StringBuffer outputBuffer = new StringBuffer(); + HtmlConverter.linkifyText(text, outputBuffer); + + assertEquals("" + + "bitcoin:19W6QZkx8SYPG7BBCS7odmWGRxqRph5jFU" + + " " + + "" + + "http://example.com/" + + "", outputBuffer.toString()); + } }