From 1d351caefaa1fdcd79029d7a86da98a94eddf4e6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 6 Feb 2022 22:41:57 +0100 Subject: [PATCH] For my own convenience --- app/src/main/java/eu/faircode/email/HtmlHelper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 4beedf5583..53ed9c314e 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -1355,6 +1355,7 @@ public class HtmlHelper { // tel: final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}"); final String GPA_LINK = "https://play.google.com/console/u/0/developers/8420080860664580239/orders/"; + final String PAYPAL = "https://www.paypal.com/activity/payment/"; final Pattern pattern = Pattern.compile( "(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" + PatternsCompat.AUTOLINK_WEB_URL.pattern() @@ -1373,6 +1374,18 @@ public class HtmlHelper { TextNode tnode = (TextNode) node; String text = tnode.getWholeText(); + if (BuildConfig.DEBUG && node.parentNode() instanceof Element) { + Element parent = (Element) node.parentNode(); + if ("faircode_txn_id".equals(parent.className())) { + Element a = document.createElement("a"); + a.attr("href", PAYPAL + text.trim()); + a.text(text); + tnode.before(a); + tnode.text(""); + return; + } + } + Matcher matcher = pattern.matcher(text); if (matcher.find()) { Element span = document.createElement("span");