For my own convenience

pull/194/merge
M66B 3 years ago
parent e564adf4d8
commit 1d351caefa

@ -1355,6 +1355,7 @@ public class HtmlHelper {
// tel:<phonenumber> // tel:<phonenumber>
final Pattern GPA_PATTERN = Pattern.compile("GPA\\.\\d{4}-\\d{4}-\\d{4}-\\d{5}"); 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 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( final Pattern pattern = Pattern.compile(
"(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" + "(((?i:mailto):)?" + PatternsCompat.AUTOLINK_EMAIL_ADDRESS.pattern() + ")|" +
PatternsCompat.AUTOLINK_WEB_URL.pattern() PatternsCompat.AUTOLINK_WEB_URL.pattern()
@ -1373,6 +1374,18 @@ public class HtmlHelper {
TextNode tnode = (TextNode) node; TextNode tnode = (TextNode) node;
String text = tnode.getWholeText(); 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); Matcher matcher = pattern.matcher(text);
if (matcher.find()) { if (matcher.find()) {
Element span = document.createElement("span"); Element span = document.createElement("span");

Loading…
Cancel
Save