From ea6e8ac2a89ad08eb82f14d6761015d0361e823b Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 27 Nov 2023 22:15:21 +0100 Subject: [PATCH] JSON-LD primitives --- .../eu/faircode/email/StructuredEmail.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/StructuredEmail.java b/app/src/main/java/eu/faircode/email/StructuredEmail.java index bb77e8dcba..2cf20c916d 100644 --- a/app/src/main/java/eu/faircode/email/StructuredEmail.java +++ b/app/src/main/java/eu/faircode/email/StructuredEmail.java @@ -63,7 +63,7 @@ public class StructuredEmail { Iterator keys = jobject.keys(); while (keys.hasNext()) { String key = keys.next(); - if (key == null || key.startsWith("@")) + if (key == null) continue; Object v = (jobject.isNull(key) ? "" : jobject.get(key)); if (v instanceof JSONObject || v instanceof JSONArray) { @@ -72,18 +72,6 @@ public class StructuredEmail { .append('\n'); getHtml(v, indent + 1, sb); } else { - if (v instanceof String) { - String s = (String) v; - if (s.startsWith("https://")) - try { - Uri uri = Uri.parse(s); - String p = uri.getPath(); - if (!TextUtils.isEmpty(p)) - v = split(p.substring(1)); - } catch (Throwable ex) { - Log.w(ex); - } - } sb.append(indent(indent)) .append(split(key)) .append(": ") @@ -95,6 +83,10 @@ public class StructuredEmail { JSONArray jarray = (JSONArray) obj; for (int i = 0; i < jarray.length(); i++) getHtml(jarray.get(i), indent + 1, sb); + } else { + sb.append(indent(indent)) + .append(obj == null ? "" : obj.toString()) + .append('\n'); } }